/*FINAL MODELS: Using 127 dataset mixlogitNP15.dta (time in days: travel time + onsite time, cost in $1000: permile*distance + entrance fee + lodging + meals*/

clear all

set memory 5g
insheet using "C:\Users\Student\Desktop\ZCHEN\mixlogitNP15.csv"

/********************* New fstata from matlab to stata******************/
rename v1 gid

rename v2 nid
rename v3 cost
rename v4 time
rename v5 x
rename v6 cs

rename v7 prtf
rename v8 ar
rename v9 bc
rename v10 ca
rename v11 gc
rename v12 mv
rename v13 pf
rename v14 zi
rename v15 oldprtf

drop v16
rename v17 triplen1
rename v18 renter
rename v19 triplen2
rename v20 totstop
rename v21 totstopr
rename v22 flextime
rename v23 maxtrip
rename v24 income
rename v25 prtfch
rename v26 weight


replace triplen1=. if triplen1==999
replace triplen2=. if triplen2==999
replace totstopr=. if totstopr==999
replace income=. if income==999
replace flextime=. if flextime==999
replace renter=. if renter==999
replace maxtrip=. if maxtrip==999

drop oldprtf maxtrip /*maxtrip is not correct in this dataset*/

gen prtfd=0
replace prtfd=1 if prtf==prtfch
gen inc=income/1000


/*******************New cost variable - Value of time included***************/

gen vt=inc/250
gen vt3=inc/250/3
tab vt
tabstat vt, stat(mean median min max)
tab vt3
tabstat vt3, stat(mean median min max)

gen ncost=time*vt + cost
gen ncflextime=ncost*flextime
gen ncrenter=ncost*renter
gen ncinc=ncost*inc

gen ncost3=time*vt3 + cost
gen ncflextime3=ncost3*flextime
gen ncrenter3=ncost3*renter
gen ncinc3=ncost3*inc
gen ncother3=ncost3*totstop

gen other=.
replace other=1 if totstop>0
replace other=0 if totstop==0
gen ncotherd3=ncost3*other



save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\mixlogitNP15.dta"
use "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\mixlogitNP15.dta"

/************************New Weights Add-in, and merge with the old file********************************/

clear all
insheet using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\weights adjustment\newweights.csv"

rename v1 nid
rename v2 bsweight
rename v3 nweight

merge m:m nid using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step3\VmixlogitNP15.dta"
drop _merge
save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step3\nwVmixlogitNP15.dta", replace





/*********************** Model Estimation - 3 sets of Models, 127 PORTFOLIOS*********************/
use "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step3\nwVmixlogitNP15.dta"

//**********STANDARD LOGIT MODEL*******//
log using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step3\SL_models.smcl"

clogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3 ar bc ca gc mv pf zi [pweight=nweight], group(gid)
estat ic
vif, uncentered
estimates store full1
predict phat

clogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3 ar bc ca gc mv pf zi zar zbc zca zgc zmv zpf zzi[pweight=nweight], group(gid)
estat ic
estimates store fullz
lrtest full1 fullz, stats force

/*clogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncother3 ar bc ca gc mv pf zi [pweight=nweight], group(gid)
estat ic
vif, uncentered
estimates store full2
estat summarize


clogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ar bc ca gc mv pf zi [pweight=nweight], group(gid)
estat ic
vif, uncentered
estimates store old
lrtest old full1, stats force
lrtest old full2, stats force

clogit prtfd ncost3 ncrenter3 ncinc3 ncotherd3 ar bc ca gc mv pf zi [pweight=nweight], group(gid)
estat ic
vif, uncentered
estimates store new1
lrtest new1 full1, stats force


clogit prtfd ncost3 ncrenter3 ncinc3 ncother3 ar bc ca gc mv pf zi [pweight=nweight], group(gid)
estat ic
vif, uncentered
estimates store new2
lrtest new2 full2, stats force*/

log close

saveold "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\nwVEH_SLforSAS15.dta",replace



clogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ar bc ca gc mv pf zi ASC4 ASC5 ASC50 ASC24 ASC18 ASC9 ASC1 ASC7 ASC25 ASC35 ASC101 ASC92 ASC6 ASC67 ASC121 ASC60 ASC2 ASC23 ASC70 ASC33 ASC107 ASC122 ASC11 ASC15 ASC91 [iweight=weight],group(gid)



//**********MIXED LOGIT MODEL ***********//

/************************Run this first before starting the log!!!!!!!!!!!!!*******************/

do "C:\Users\Student\Desktop\zchen\Dissertation - National Park\STATA data and code\mixlogit 2010\mixlbeta.ado"
do "C:\Users\Student\Desktop\zchen\Dissertation - National Park\STATA data and code\mixlogit 2010\mixlcov.ado"
do "C:\Users\Student\Desktop\zchen\Dissertation - National Park\STATA data and code\mixlogit 2010\mixlog_d1.ado"
do "C:\Users\Student\Desktop\zchen\Dissertation - National Park\STATA data and code\mixlogit 2010\mixlogit.ado"
do "C:\Users\Student\Desktop\zchen\Dissertation - National Park\STATA data and code\mixlogit 2010\mixlpred.ado"

log using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step3\MXL_simple_models_d.smcl"

//ALL PARKS VARY//
global randvars "ar bc ca gc mv pf zi"
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) nrep(100)
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) nrep(200)
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) nrep(500)
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) nrep(750)
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) nrep(1000)
estat ic


//GC FIXED//
global randvars "ar bc ca mv pf zi"
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3 gc[pweight=nweight],group(gid) rand($randvars) nrep(100) 
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3 gc[pweight=nweight],group(gid) rand($randvars) nrep(1000) 
estat ic

log close

log using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step3\MXL_corr_models_d.smcl"

//ALL PARKS VARY WITH COV//
global randvars "ar bc ca gc mv pf zi"
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) corr nrep(100)
mixlcov, sd
mixlcov
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) corr nrep(200)
mixlcov, sd
mixlcov
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) corr nrep(500)
mixlcov, sd
mixlcov
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) corr nrep(750)
mixlcov, sd
mixlcov
mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3[pweight=nweight],group(gid) rand($randvars) corr nrep(1000)
mixlcov, sd
mixlcov
estat ic

log close

//TOP25 ASCs + MIXED LOGIT MODEL - GC FIXED WITHOUT COVARIANCE//

//global randvars "ar bc ca mv pf zi"
//mixlogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 gc ASC50 ASC24 ASC18 ASC9 ASC25 ASC35 ASC101 ASC92 ASC67 ASC121 ASC60 ASC23 ASC70 ASC33 ASC107 ASC122	ASC11	ASC15	ASC91	ASC10	ASC103 ASC127 ASC118 ASC13 ASC49 [iweight=weight],group(gid) rand($randvars) nrep(100)



//*******111 PSC MODEL*******//

//asclogit prtfd ncost3 [pweight=weight],case(gid) alt(prtf) casev(flextime renter inc)
//asclogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 [pweight=weight],case(gid) alt(prtf) base(16)


local i=1
while `i' <= 127 {
       gen ASC`i'=0
       replace ASC`i' = 1 if prtf==`i'
       local i=`i'+1
       }
	   
cap drop ASC42 ASC43 ASC45 ASC46 ASC51 ASC57 ASC58 ASC77 ASC83 ASC87 ASC97 ASC108 ASC110 ASC117 ASC119 ASC126
cap drop if prtf==42 | prtf==43 | prtf==45 | prtf==46 | prtf==51 | prtf==57 | prtf==58| prtf==77 | prtf==83 | prtf==87 | prtf==97 | prtf==108 | prtf==110 | prtf==117 | prtf==119 | prtf==126 

log using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step3\PSC_models_d.smcl"

clogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ncotherd3 ASC2 ASC3 ASC4 ASC5 ASC6 ASC7 ASC8 ASC9 ASC10 ASC11 ASC12 ASC13 ASC14 ASC15 ASC16 ASC17 ASC18 ASC19 ASC20 ASC21 ASC22 ASC23 ASC24 ASC25 ASC26 ASC27 ASC28 ASC29 ASC30 ASC31 ASC32 ASC33 ASC34 ASC35 ASC36 ASC37 ASC38 ASC39 ASC40 ASC41 ASC44 ASC47 ASC48 ASC49 ASC50 ASC52 ASC53 ASC54 ASC55 ASC56 ASC59 ASC60 ASC61 ASC62 ASC63 ASC64 ASC65 ASC66 ASC67 ASC68 ASC69 ASC70 ASC71 ASC72 ASC73 ASC74 ASC75 ASC76 ASC78 ASC79 ASC80 ASC81 ASC82 ASC84 ASC85 ASC86 ASC88 ASC89 ASC90 ASC91 ASC92 ASC93 ASC94 ASC95 ASC96 ASC98 ASC99 ASC100 ASC101 ASC102 ASC103 ASC104 ASC105 ASC106 ASC107 ASC109 ASC111 ASC112 ASC113 ASC114 ASC115 ASC116 ASC118 ASC120 ASC121 ASC122 ASC123 ASC124 ASC125 ASC127 ASC1[pweight=nweight],group(gid)
estat ic
estimates store psc
lrtest full1 psc, stats force
log close

saveold  "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\nwVEH_ASCforSAS15.dta", replace version(12)



//clogit prtfd ncost3 ncflextime3 ncrenter3 ncinc3 ASC1 ASC2 ASC3 ASC4 ASC5 ASC6 ASC7 ASC8 ASC9 ASC10 ASC11 ASC12 ASC13 ASC14 ASC15 ASC17 ASC18 ASC19 ASC20 ASC21 ASC22 ASC23 ASC24 ASC25 ASC26 ASC27 ASC28 ASC29 ASC30 ASC31 ASC32 ASC33 ASC34 ASC35 ASC36 ASC37 ASC38 ASC39 ASC40 ASC41 ASC42 ASC43 ASC44 ASC45 ASC46 ASC47 ASC48 ASC49 ASC50 ASC51 ASC52 ASC53 ASC54 ASC55 ASC56 ASC57 ASC58 ASC59 ASC60 ASC61 ASC62 ASC63 ASC64 ASC65 ASC66 ASC67 ASC68 ASC69 ASC70 ASC71 ASC72 ASC73 ASC74 ASC75 ASC76 ASC77 ASC78 ASC79 ASC80 ASC81 ASC82 ASC83 ASC84 ASC85 ASC86 ASC87 ASC88 ASC89 ASC90 ASC91 ASC92 ASC93 ASC94 ASC95 ASC96 ASC97 ASC98 ASC99 ASC100 ASC101 ASC102 ASC103 ASC104 ASC105 ASC106 ASC107 ASC108 ASC109 ASC110 ASC111 ASC112 ASC113 ASC114 ASC115 ASC116 ASC117 ASC118 ASC119 ASC120 ASC121 ASC122 ASC123 ASC124 ASC125 ASC126 ASC127 ASC16 [pweight=weight],group(gid)
//saveold  "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\VEH_ASCforSAS15old.dta", replace version(12)



//save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\MLAforSAS15.dta", replace



/*DO NOT USE THE FOLLOWING*/

/*******************************111 Welfare Analysis*****************************/

gen   Avall= exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*ASC16	+_b[ASC2]*ASC2	+_b[ASC3]*ASC3	+_b[ASC4]*ASC4	+_b[ASC5]*ASC5	+_b[ASC6]*ASC6	+_b[ASC7]*ASC7	+_b[ASC8]*ASC8	+_b[ASC9]*ASC9	+_b[ASC10]*ASC10	+_b[ASC11]*ASC11	+_b[ASC12]*ASC12	+_b[ASC13]*ASC13	+_b[ASC14]*ASC14	+_b[ASC15]*ASC15	+_b[ASC17]*ASC17	+_b[ASC18]*ASC18	+_b[ASC19]*ASC19	+_b[ASC20]*ASC20	+_b[ASC21]*ASC21	+_b[ASC22]*ASC22	+_b[ASC23]*ASC23 	+_b[ASC24]*ASC24	+_b[ASC25]*ASC25 	+_b[ASC26]*ASC26	+_b[ASC27]*ASC27	+_b[ASC28]*ASC28 	+_b[ASC29]*ASC29	+_b[ASC30]*ASC30	+_b[ASC31]*ASC31	+_b[ASC32]*ASC32	+_b[ASC33]*ASC33 	+_b[ASC34]*ASC34	+_b[ASC35]* ASC35	+_b[ASC36]*ASC36	+_b[ASC37]*ASC37 	+_b[ASC38]*ASC38 	+_b[ASC39]*ASC39	+_b[ASC40]*ASC40	+_b[ASC41]*ASC41 	+_b[ASC44]*ASC44 	+_b[ASC47]*ASC47 	+_b[ASC48]*ASC48	+_b[ASC49]*ASC49 	+_b[ASC50]*ASC50	+_b[ASC52]*ASC52 	+_b[ASC53]*ASC53 	+_b[ASC54]*ASC54	+_b[ASC55]*ASC55 	+_b[ASC56]*ASC56	+_b[ASC59]*ASC59	+_b[ASC60]*ASC60 	+_b[ASC61]*ASC61 	+_b[ASC62]*ASC62 	+_b[ASC63]*ASC63	+_b[ASC64]*ASC64 	+_b[ASC65]*ASC65 	+_b[ASC66]*ASC66 	+_b[ASC67]*ASC67	+_b[ASC68]*ASC68 	+_b[ASC69]*ASC69	+_b[ASC70]*ASC70 	+_b[ASC71]*ASC71 	+_b[ASC72]*ASC72 	+_b[ASC73]*ASC73	+_b[ASC74]*ASC74	+_b[ASC75]*ASC75 	+_b[ASC76]*ASC76 	+_b[ASC78]*ASC78	+_b[ASC79]*ASC79	+_b[ASC80]*ASC80	+_b[ASC81]*ASC81 	+_b[ASC82]*ASC82 	+_b[ASC84]*ASC84	+_b[ASC85]*ASC85	+_b[ASC86]*ASC86 	+_b[ASC88]*ASC88	+_b[ASC89]*ASC89 	+_b[ASC90]*ASC90	+_b[ASC91]*ASC91 	+_b[ASC92]*ASC92 	+_b[ASC93]*ASC93	+_b[ASC94]*ASC94 	+_b[ASC95]*ASC95	+_b[ASC96]*ASC96 	+_b[ASC98]*ASC98	+_b[ASC99]*ASC99 	+_b[ASC100]*ASC100 	+_b[ASC101]*ASC101	+_b[ASC102]*ASC102 	+_b[ASC103]*ASC103 	+_b[ASC104]*ASC104 	+_b[ASC105]*ASC105 	+_b[ASC106]*ASC106	+_b[ASC107]*ASC107 	+_b[ASC109]*ASC109 	+_b[ASC111]*ASC111 	+_b[ASC112]*ASC112	+_b[ASC113]*ASC113	+_b[ASC114]*ASC114 	+_b[ASC115]*ASC115 	+_b[ASC116]*ASC116	+_b[ASC118]*ASC118 	+_b[ASC120]*ASC120 	+_b[ASC121]*ASC121 	+_b[ASC122]*ASC122	+_b[ASC123]*ASC123 	+_b[ASC124]*ASC124	+_b[ASC125]*ASC125	+_b[ASC127]*ASC127)
cap drop ASC1-ASC127	

																																																																																																																														
local i=1
while `i' <= 127 {
       gen ASC`i'=0
       replace ASC`i' = 1 if prtf==`i'
       local i=`i'+1
       }																																																																																																																															

local i=1		   
while `i' <= 127 {																																																																																																																															
       gen aASC`i'= ASC`i'																																																																																																																															
       replace aASC`i' = 0 if ASC`i'==1 & ar==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }					
	   
cap drop aASC42 aASC43 aASC45 aASC46 aASC51 aASC57 aASC58 aASC77 aASC83 aASC87 aASC97 aASC108 aASC110 aASC117 aASC119 aASC126

gen   Avar=  exp(_b[ncost3]*ncost3   +_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*aASC16	+_b[ASC2]*aASC2	+_b[ASC3]*aASC3    +_b[ASC4]*aASC4   +_b[ASC5]*aASC5   +_b[ASC6]*aASC6   +_b[ASC7]*aASC7   +_b[ASC8]*aASC8   +_b[ASC9]*aASC9   +_b[ASC10]*aASC10	+_b[ASC11]*aASC11	+_b[ASC12]*aASC12	+_b[ASC13]*aASC13	+_b[ASC14]*aASC14	+_b[ASC15]*aASC15	+_b[ASC17]*aASC17	+_b[ASC18]*aASC18	+_b[ASC19]*aASC19	+_b[ASC20]*aASC20	+_b[ASC21]*aASC21	+_b[ASC22]*aASC22	+_b[ASC23]*aASC23	+_b[ASC24]*aASC24	+_b[ASC25]*aASC25	+_b[ASC26]*aASC26	+_b[ASC27]*aASC27	+_b[ASC28]*aASC28	+_b[ASC29]*aASC29	+_b[ASC30]*aASC30	+_b[ASC31]*aASC31	+_b[ASC32]*aASC32	+_b[ASC33]*aASC33	+_b[ASC34]*aASC34	+_b[ASC35]*aASC35	+_b[ASC36]*aASC36	+_b[ASC37]*aASC37	+_b[ASC38]*aASC38	+_b[ASC39]*aASC39	+_b[ASC40]*aASC40	+_b[ASC41]*aASC41	+_b[ASC44]*aASC44	+_b[ASC47]*aASC47	+_b[ASC48]*aASC48	+_b[ASC49]*aASC49	+_b[ASC50]*aASC50	+_b[ASC52]*aASC52	+_b[ASC53]*aASC53	+_b[ASC54]*aASC54	+_b[ASC55]*aASC55	+_b[ASC56]*aASC56	+_b[ASC59]*aASC59	+_b[ASC60]*aASC60	+_b[ASC61]*aASC61	+_b[ASC62]*aASC62	+_b[ASC63]*aASC63	+_b[ASC64]*aASC64	+_b[ASC65]*aASC65	+_b[ASC66]*aASC66	+_b[ASC67]*aASC67	+_b[ASC68]*aASC68	+_b[ASC69]*aASC69	+_b[ASC70]*aASC70	+_b[ASC71]*aASC71	+_b[ASC72]*aASC72	+_b[ASC73]*aASC73	+_b[ASC74]*aASC74	+_b[ASC75]*aASC75	+_b[ASC76]*aASC76	+_b[ASC78]*aASC78	+_b[ASC79]*aASC79	+_b[ASC80]*aASC80	+_b[ASC81]*aASC81	+_b[ASC82]*aASC82	+_b[ASC84]*aASC84	+_b[ASC85]*aASC85	+_b[ASC86]*aASC86	+_b[ASC88]*aASC88	+_b[ASC89]*aASC89	+_b[ASC90]*aASC90	+_b[ASC91]*aASC91	+_b[ASC92]*aASC92	+_b[ASC93]*aASC93	+_b[ASC94]*aASC94	+_b[ASC95]*aASC95	+_b[ASC96]*aASC96	+_b[ASC98]*aASC98	+_b[ASC99]*aASC99	+_b[ASC100]*aASC100	+_b[ASC101]*aASC101	+_b[ASC102]*aASC102	+_b[ASC103]*aASC103	+_b[ASC104]*aASC104	+_b[ASC105]*aASC105	+_b[ASC106]*aASC106	+_b[ASC107]*aASC107		+_b[ASC109]*aASC109	+_b[ASC111]*aASC111	+_b[ASC112]*aASC112	+_b[ASC113]*aASC113	+_b[ASC114]*aASC114	+_b[ASC115]*aASC115	+_b[ASC116]*aASC116	+_b[ASC118]*aASC118	+_b[ASC120]*aASC120	+_b[ASC121]*aASC121	+_b[ASC122]*aASC122	+_b[ASC123]*aASC123	+_b[ASC124]*aASC124	+_b[ASC125]*aASC125	+_b[ASC127]*aASC127)											
cap drop aASC1-aASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen bASC`i'= ASC`i'																																																																																																																															
       replace bASC`i' = 0 if ASC`i'==1 & bc==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }	
	   
drop bASC42 bASC43 bASC45 bASC46 bASC51 bASC57 bASC58 bASC77 bASC83 bASC87 bASC97 bASC108 bASC110 bASC117 bASC119 bASC126

gen	Avbc=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*bASC16	+_b[ASC2]*bASC2	+_b[ASC3]*bASC3	+_b[ASC4]*bASC4	+_b[ASC5]*bASC5 	+_b[ASC6]*bASC6	+_b[ASC7]*bASC7	+_b[ASC8]*bASC8	+_b[ASC9]*bASC9	+_b[ASC10]*bASC10	+_b[ASC11]*bASC11	+_b[ASC12]*bASC12	+_b[ASC13]*bASC13	+_b[ASC14]*bASC14	+_b[ASC15]*bASC15	+_b[ASC17]*bASC17	+_b[ASC18]*bASC18	+_b[ASC19]*bASC19	+_b[ASC20]*bASC20	+_b[ASC21]*bASC21	+_b[ASC22]*bASC22	+_b[ASC23]*bASC23	+_b[ASC24]*bASC24	+_b[ASC25]*bASC25	+_b[ASC26]*bASC26	+_b[ASC27]*bASC27	+_b[ASC28]*bASC28	+_b[ASC29]*bASC29	+_b[ASC30]*bASC30	+_b[ASC31]*bASC31	+_b[ASC32]*bASC32	+_b[ASC33]*bASC33	+_b[ASC34]*bASC34	+_b[ASC35]*bASC35	+_b[ASC36]*bASC36	+_b[ASC37]*bASC37	+_b[ASC38]*bASC38	+_b[ASC39]*bASC39	+_b[ASC40]*bASC40	+_b[ASC41]*bASC41	+_b[ASC44]*bASC44	+_b[ASC47]*bASC47	+_b[ASC48]*bASC48	+_b[ASC49]*bASC49	+_b[ASC50]*bASC50	+_b[ASC52]*bASC52	+_b[ASC53]*bASC53	+_b[ASC54]*bASC54	+_b[ASC55]*bASC55	+_b[ASC56]*bASC56	+_b[ASC59]*bASC59	+_b[ASC60]*bASC60	+_b[ASC61]*bASC61	+_b[ASC62]*bASC62	+_b[ASC63]*bASC63	+_b[ASC64]*bASC64	+_b[ASC65]*bASC65	+_b[ASC66]*bASC66	+_b[ASC67]*bASC67	+_b[ASC68]*bASC68	+_b[ASC69]*bASC69	+_b[ASC70]*bASC70	+_b[ASC71]*bASC71	+_b[ASC72]*bASC72	+_b[ASC73]*bASC73	+_b[ASC74]*bASC74	+_b[ASC75]*bASC75	+_b[ASC76]*bASC76	+_b[ASC78]*bASC78	+_b[ASC79]*bASC79	+_b[ASC80]*bASC80	+_b[ASC81]*bASC81	+_b[ASC82]*bASC82	+_b[ASC84]*bASC84	+_b[ASC85]*bASC85	+_b[ASC86]*bASC86	+_b[ASC88]*bASC88	+_b[ASC89]*bASC89	+_b[ASC90]*bASC90	+_b[ASC91]*bASC91	+_b[ASC92]*bASC92	+_b[ASC93]*bASC93	+_b[ASC94]*bASC94	+_b[ASC95]*bASC95	+_b[ASC96]*bASC96	+_b[ASC98]*bASC98	+_b[ASC99]*bASC99	+_b[ASC100]*bASC100	+_b[ASC101]*bASC101	+_b[ASC102]*bASC102	+_b[ASC103]*bASC103	+_b[ASC104]*bASC104	+_b[ASC105]*bASC105	+_b[ASC106]*bASC106	+_b[ASC107]*bASC107	+_b[ASC109]*bASC109	+_b[ASC111]*bASC111	+_b[ASC112]*bASC112	+_b[ASC113]*bASC113	+_b[ASC114]*bASC114	+_b[ASC115]*bASC115	+_b[ASC116]*bASC116	+_b[ASC118]*bASC118	+_b[ASC120]*bASC120	+_b[ASC121]*bASC121	+_b[ASC122]*bASC122	+_b[ASC123]*bASC123	+_b[ASC124]*bASC124	+_b[ASC125]*bASC125	+_b[ASC127]*bASC127)
cap drop bASC1-bASC127																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen cASC`i'= ASC`i'																																																																																																																															
       replace cASC`i' = 0 if ASC`i'==1 & ca==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															

drop cASC42 cASC43 cASC45 cASC46 cASC51 cASC57 cASC58 cASC77 cASC83 cASC87 cASC97 cASC108 cASC110 cASC117 cASC119 cASC126

gen	Avca=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*cASC16	+_b[ASC2]*cASC2	+_b[ASC3]*cASC3	+_b[ASC4]*cASC4	+_b[ASC5]*cASC5	+_b[ASC6]*cASC6	+_b[ASC7]*cASC7	+_b[ASC8]*cASC8	+_b[ASC9]*cASC9	+_b[ASC10]*cASC10	+_b[ASC11]*cASC11	+_b[ASC12]*cASC12	+_b[ASC13]*cASC13	+_b[ASC14]*cASC14	+_b[ASC15]*cASC15	+_b[ASC17]*cASC17	+_b[ASC18]*cASC18	+_b[ASC19]*cASC19	+_b[ASC20]*cASC20	+_b[ASC21]*cASC21	+_b[ASC22]*cASC22	+_b[ASC23]*cASC23	+_b[ASC24]*cASC24	+_b[ASC25]*cASC25	+_b[ASC26]*cASC26	+_b[ASC27]*cASC27	+_b[ASC28]*cASC28	+_b[ASC29]*cASC29	+_b[ASC30]*cASC30	+_b[ASC31]*cASC31	+_b[ASC32]*cASC32	+_b[ASC33]*cASC33	+_b[ASC34]*cASC34	+_b[ASC35]*cASC35	+_b[ASC36]*cASC36	+_b[ASC37]*cASC37	+_b[ASC38]*cASC38	+_b[ASC39]*cASC39	+_b[ASC40]*cASC40	+_b[ASC41]*cASC41	+_b[ASC44]*cASC44	+_b[ASC47]*cASC47	+_b[ASC48]*cASC48	+_b[ASC49]*cASC49	+_b[ASC50]*cASC50	+_b[ASC52]*cASC52	+_b[ASC53]*cASC53	+_b[ASC54]*cASC54	+_b[ASC55]*cASC55	+_b[ASC56]*cASC56	+_b[ASC59]*cASC59	+_b[ASC60]*cASC60	+_b[ASC61]*cASC61	+_b[ASC62]*cASC62	+_b[ASC63]*cASC63	+_b[ASC64]*cASC64	+_b[ASC65]*cASC65	+_b[ASC66]*cASC66	+_b[ASC67]*cASC67	+_b[ASC68]*cASC68	+_b[ASC69]*cASC69	+_b[ASC70]*cASC70	+_b[ASC71]*cASC71	+_b[ASC72]*cASC72	+_b[ASC73]*cASC73	+_b[ASC74]*cASC74	+_b[ASC75]*cASC75	+_b[ASC76]*cASC76	+_b[ASC78]*cASC78	+_b[ASC79]*cASC79	+_b[ASC80]*cASC80	+_b[ASC81]*cASC81	+_b[ASC82]*cASC82	+_b[ASC84]*cASC84	+_b[ASC85]*cASC85	+_b[ASC86]*cASC86	+_b[ASC88]*cASC88	+_b[ASC89]*cASC89	+_b[ASC90]*cASC90	+_b[ASC91]*cASC91	+_b[ASC92]*cASC92	+_b[ASC93]*cASC93	+_b[ASC94]*cASC94	+_b[ASC95]*cASC95	+_b[ASC96]*cASC96	+_b[ASC98]*cASC98	+_b[ASC99]*cASC99	+_b[ASC100]*cASC100	+_b[ASC101]*cASC101	+_b[ASC102]*cASC102	+_b[ASC103]*cASC103	+_b[ASC104]*cASC104	+_b[ASC105]*cASC105	+_b[ASC106]*cASC106	+_b[ASC107]*cASC107		+_b[ASC109]*cASC109	+_b[ASC111]*cASC111	+_b[ASC112]*cASC112	+_b[ASC113]*cASC113	+_b[ASC114]*cASC114	+_b[ASC115]*cASC115	+_b[ASC116]*cASC116	+_b[ASC118]*cASC118		+_b[ASC120]*cASC120	+_b[ASC121]*cASC121	+_b[ASC122]*cASC122	+_b[ASC123]*cASC123	+_b[ASC124]*cASC124	+_b[ASC125]*cASC125	+_b[ASC127]*cASC127)
																																																																																																																															
cap drop cASC1-cASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen gASC`i'= ASC`i'																																																																																																																															
       replace gASC`i' = 0 if ASC`i'==1 & gc==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }
	   
drop gASC42 gASC43 gASC45 gASC46 gASC51 gASC57 gASC58 gASC77 gASC83 gASC87 gASC97 gASC108 gASC110 gASC117 gASC119 gASC126

gen	Avgc=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*gASC16	+_b[ASC2]*gASC2	+_b[ASC3]*gASC3	+_b[ASC4]*gASC4	+_b[ASC5]*gASC5	+_b[ASC6]*gASC6	+_b[ASC7]*gASC7	+_b[ASC8]*gASC8	+_b[ASC9]*gASC9	+_b[ASC10]*gASC10	+_b[ASC11]*gASC11	+_b[ASC12]*gASC12	+_b[ASC13]*gASC13	+_b[ASC14]*gASC14	+_b[ASC15]*gASC15	+_b[ASC17]*gASC17	+_b[ASC18]*gASC18	+_b[ASC19]*gASC19	+_b[ASC20]*gASC20	+_b[ASC21]*gASC21	+_b[ASC22]*gASC22	+_b[ASC23]*gASC23	+_b[ASC24]*gASC24	+_b[ASC25]*gASC25	+_b[ASC26]*gASC26	+_b[ASC27]*gASC27	+_b[ASC28]*gASC28	+_b[ASC29]*gASC29	+_b[ASC30]*gASC30	+_b[ASC31]*gASC31	+_b[ASC32]*gASC32	+_b[ASC33]*gASC33	+_b[ASC34]*gASC34	+_b[ASC35]*gASC35	+_b[ASC36]*gASC36	+_b[ASC37]*gASC37	+_b[ASC38]*gASC38	+_b[ASC39]*gASC39	+_b[ASC40]*gASC40	+_b[ASC41]*gASC41	+_b[ASC44]*gASC44	+_b[ASC47]*gASC47	+_b[ASC48]*gASC48	+_b[ASC49]*gASC49	+_b[ASC50]*gASC50	+_b[ASC52]*gASC52	+_b[ASC53]*gASC53	+_b[ASC54]*gASC54	+_b[ASC55]*gASC55	+_b[ASC56]*gASC56	+_b[ASC59]*gASC59	+_b[ASC60]*gASC60	+_b[ASC61]*gASC61	+_b[ASC62]*gASC62	+_b[ASC63]*gASC63	+_b[ASC64]*gASC64	+_b[ASC65]*gASC65	+_b[ASC66]*gASC66	+_b[ASC67]*gASC67	+_b[ASC68]*gASC68	+_b[ASC69]*gASC69	+_b[ASC70]*gASC70	+_b[ASC71]*gASC71	+_b[ASC72]*gASC72	+_b[ASC73]*gASC73	+_b[ASC74]*gASC74	+_b[ASC75]*gASC75	+_b[ASC76]*gASC76	+_b[ASC78]*gASC78	+_b[ASC79]*gASC79	+_b[ASC80]*gASC80	+_b[ASC81]*gASC81	+_b[ASC82]*gASC82	+_b[ASC84]*gASC84	+_b[ASC85]*gASC85	+_b[ASC86]*gASC86	+_b[ASC88]*gASC88	+_b[ASC89]*gASC89	+_b[ASC90]*gASC90	+_b[ASC91]*gASC91	+_b[ASC92]*gASC92	+_b[ASC93]*gASC93	+_b[ASC94]*gASC94	+_b[ASC95]*gASC95	+_b[ASC96]*gASC96	+_b[ASC98]*gASC98	+_b[ASC99]*gASC99	+_b[ASC100]*gASC100	+_b[ASC101]*gASC101	+_b[ASC102]*gASC102	+_b[ASC103]*gASC103	+_b[ASC104]*gASC104	+_b[ASC105]*gASC105	+_b[ASC106]*gASC106	+_b[ASC107]*gASC107		+_b[ASC109]*gASC109	+_b[ASC111]*gASC111	+_b[ASC112]*gASC112	+_b[ASC113]*gASC113	+_b[ASC114]*gASC114	+_b[ASC115]*gASC115	+_b[ASC116]*gASC116	+_b[ASC118]*gASC118	+_b[ASC120]*gASC120	+_b[ASC121]*gASC121	+_b[ASC122]*gASC122	+_b[ASC123]*gASC123	+_b[ASC124]*gASC124	+_b[ASC125]*gASC125	+_b[ASC127]*gASC127)
																																																																																																																															
cap drop gASC1-gASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen mASC`i'= ASC`i'																																																																																																																															
       replace mASC`i' = 0 if ASC`i'==1 & mv==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }	
	   
drop mASC42 mASC43 mASC45 mASC46 mASC51 mASC57 mASC58 mASC77 mASC83 mASC87 mASC97 mASC108 mASC110 mASC117 mASC119 mASC126

gen	Avmv=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*mASC16	+_b[ASC2]*mASC2	+_b[ASC3]*mASC3	+_b[ASC4]*mASC4	+_b[ASC5]*mASC5	+_b[ASC6]*mASC6	+_b[ASC7]*mASC7	+_b[ASC8]*mASC8	+_b[ASC9]*mASC9	+_b[ASC10]*mASC10	+_b[ASC11]*mASC11	+_b[ASC12]*mASC12	+_b[ASC13]*mASC13	+_b[ASC14]*mASC14	+_b[ASC15]*mASC15	+_b[ASC17]*mASC17	+_b[ASC18]*mASC18	+_b[ASC19]*mASC19	+_b[ASC20]*mASC20	+_b[ASC21]*mASC21	+_b[ASC22]*mASC22	+_b[ASC23]*mASC23	+_b[ASC24]*mASC24	+_b[ASC25]*mASC25	+_b[ASC26]*mASC26	+_b[ASC27]*mASC27	+_b[ASC28]*mASC28	+_b[ASC29]*mASC29	+_b[ASC30]*mASC30	+_b[ASC31]*mASC31	+_b[ASC32]*mASC32	+_b[ASC33]*mASC33	+_b[ASC34]*mASC34	+_b[ASC35]* mASC35	+_b[ASC36]*mASC36	+_b[ASC37]*mASC37	+_b[ASC38]*mASC38	+_b[ASC39]*mASC39	+_b[ASC40]*mASC40	+_b[ASC41]*mASC41	+_b[ASC44]*mASC44	+_b[ASC47]*mASC47	+_b[ASC48]*mASC48	+_b[ASC49]*mASC49	+_b[ASC50]*mASC50	+_b[ASC52]*mASC52	+_b[ASC53]*mASC53	+_b[ASC54]*mASC54	+_b[ASC55]*mASC55	+_b[ASC56]*mASC56	+_b[ASC59]*mASC59	+_b[ASC60]*mASC60	+_b[ASC61]*mASC61	+_b[ASC62]*mASC62	+_b[ASC63]*mASC63	+_b[ASC64]*mASC64	+_b[ASC65]*mASC65	+_b[ASC66]*mASC66	+_b[ASC67]*mASC67	+_b[ASC68]*mASC68	+_b[ASC69]*mASC69	+_b[ASC70]*mASC70	+_b[ASC71]*mASC71	+_b[ASC72]*mASC72	+_b[ASC73]*mASC73	+_b[ASC74]*mASC74	+_b[ASC75]*mASC75	+_b[ASC76]*mASC76	+_b[ASC78]*mASC78	+_b[ASC79]*mASC79	+_b[ASC80]*mASC80	+_b[ASC81]*mASC81	+_b[ASC82]*mASC82	+_b[ASC84]*mASC84	+_b[ASC85]*mASC85	+_b[ASC86]*mASC86	+_b[ASC88]*mASC88	+_b[ASC89]*mASC89	+_b[ASC90]*mASC90	+_b[ASC91]*mASC91	+_b[ASC92]*mASC92	+_b[ASC93]*mASC93	+_b[ASC94]*mASC94	+_b[ASC95]*mASC95	+_b[ASC96]*mASC96	+_b[ASC98]*mASC98	+_b[ASC99]*mASC99	+_b[ASC100]*mASC100	+_b[ASC101]*mASC101	+_b[ASC102]*mASC102	+_b[ASC103]*mASC103	+_b[ASC104]*mASC104	+_b[ASC105]*mASC105	+_b[ASC106]*mASC106	+_b[ASC107]*mASC107	+_b[ASC109]*mASC109	+_b[ASC111]*mASC111	+_b[ASC112]*mASC112	+_b[ASC113]*mASC113	+_b[ASC114]*mASC114	+_b[ASC115]*mASC115	+_b[ASC116]*mASC116	+_b[ASC118]*mASC118	+_b[ASC120]*mASC120	+_b[ASC121]*mASC121	+_b[ASC122]*mASC122	+_b[ASC123]*mASC123	+_b[ASC124]*mASC124	+_b[ASC125]*mASC125	+_b[ASC127]*mASC127)
																																																																																																																															
cap drop mASC1-mASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen pASC`i'= ASC`i'																																																																																																																															
       replace pASC`i' = 0 if ASC`i'==1 & pf==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }	
	   
drop pASC42 pASC43 pASC45 pASC46 pASC51 pASC57 pASC58 pASC77 pASC83 pASC87 pASC97 pASC108 pASC110 pASC117 pASC119 pASC126

gen	Avpf=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*pASC16	+_b[ASC2]*pASC2	+_b[ASC3]*pASC3	+_b[ASC4]*pASC4	+_b[ASC5]*pASC5	+_b[ASC6]*pASC6	+_b[ASC7]*pASC7	+_b[ASC8]*pASC8	+_b[ASC9]*pASC9	+_b[ASC10]*pASC10	+_b[ASC11]*pASC11	+_b[ASC12]*pASC12	+_b[ASC13]*pASC13	+_b[ASC14]*pASC14	+_b[ASC15]*pASC15	+_b[ASC17]*pASC17	+_b[ASC18]*pASC18	+_b[ASC19]*pASC19	+_b[ASC20]*pASC20	+_b[ASC21]*pASC21	+_b[ASC22]*pASC22	+_b[ASC23]*pASC23	+_b[ASC24]*pASC24	+_b[ASC25]*pASC25	+_b[ASC26]*pASC26	+_b[ASC27]*pASC27	+_b[ASC28]*pASC28	+_b[ASC29]*pASC29	+_b[ASC30]*pASC30	+_b[ASC31]*pASC31	+_b[ASC32]*pASC32	+_b[ASC33]*pASC33	+_b[ASC34]*pASC34	+_b[ASC35]* pASC35	+_b[ASC36]*pASC36	+_b[ASC37]*pASC37	+_b[ASC38]*pASC38	+_b[ASC39]*pASC39	+_b[ASC40]*pASC40	+_b[ASC41]*pASC41	+_b[ASC44]*pASC44	+_b[ASC47]*pASC47	+_b[ASC48]*pASC48	+_b[ASC49]*pASC49	+_b[ASC50]*pASC50	+_b[ASC52]*pASC52	+_b[ASC53]*pASC53	+_b[ASC54]*pASC54	+_b[ASC55]*pASC55	+_b[ASC56]*pASC56	+_b[ASC59]*pASC59	+_b[ASC60]*pASC60	+_b[ASC61]*pASC61	+_b[ASC62]*pASC62	+_b[ASC63]*pASC63	+_b[ASC64]*pASC64	+_b[ASC65]*pASC65	+_b[ASC66]*pASC66	+_b[ASC67]*pASC67	+_b[ASC68]*pASC68	+_b[ASC69]*pASC69	+_b[ASC70]*pASC70	+_b[ASC71]*pASC71	+_b[ASC72]*pASC72	+_b[ASC73]*pASC73	+_b[ASC74]*pASC74	+_b[ASC75]*pASC75	+_b[ASC76]*pASC76	+_b[ASC78]*pASC78	+_b[ASC79]*pASC79	+_b[ASC80]*pASC80	+_b[ASC81]*pASC81	+_b[ASC82]*pASC82	+_b[ASC84]*pASC84	+_b[ASC85]*pASC85	+_b[ASC86]*pASC86	+_b[ASC88]*pASC88	+_b[ASC89]*pASC89	+_b[ASC90]*pASC90	+_b[ASC91]*pASC91	+_b[ASC92]*pASC92	+_b[ASC93]*pASC93	+_b[ASC94]*pASC94	+_b[ASC95]*pASC95	+_b[ASC96]*pASC96	+_b[ASC98]*pASC98	+_b[ASC99]*pASC99	+_b[ASC100]*pASC100	+_b[ASC101]*pASC101	+_b[ASC102]*pASC102	+_b[ASC103]*pASC103	+_b[ASC104]*pASC104	+_b[ASC105]*pASC105	+_b[ASC106]*pASC106	+_b[ASC107]*pASC107	+_b[ASC109]*pASC109	+_b[ASC111]*pASC111	+_b[ASC112]*pASC112	+_b[ASC113]*pASC113	+_b[ASC114]*pASC114	+_b[ASC115]*pASC115	+_b[ASC116]*pASC116	+_b[ASC118]*pASC118	+_b[ASC120]*pASC120	+_b[ASC121]*pASC121	+_b[ASC122]*pASC122	+_b[ASC123]*pASC123	+_b[ASC124]*pASC124	+_b[ASC125]*pASC125	+_b[ASC127]*pASC127)
																																																																																																																															
cap drop pASC1-pASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen zASC`i'= ASC`i'																																																																																																																															
       replace zASC`i' = 0 if ASC`i'==1 & zi==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }
	   
drop zASC42 zASC43 zASC45 zASC46 zASC51 zASC57 zASC58 zASC77 zASC83 zASC87 zASC97 zASC108 zASC110 zASC117 zASC119 zASC126

gen	Avzi=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*zASC16	+_b[ASC2]*zASC2	+_b[ASC3]*zASC3	+_b[ASC4]*zASC4	+_b[ASC5]*zASC5	+_b[ASC6]*zASC6	+_b[ASC7]*zASC7	+_b[ASC8]*zASC8	+_b[ASC9]*zASC9	+_b[ASC10]*zASC10	+_b[ASC11]*zASC11	+_b[ASC12]*zASC12	+_b[ASC13]*zASC13	+_b[ASC14]*zASC14	+_b[ASC15]*zASC15	+_b[ASC17]*zASC17	+_b[ASC18]*zASC18	+_b[ASC19]*zASC19	+_b[ASC20]*zASC20	+_b[ASC21]*zASC21	+_b[ASC22]*zASC22	+_b[ASC23]*zASC23	+_b[ASC24]*zASC24	+_b[ASC25]*zASC25	+_b[ASC26]*zASC26	+_b[ASC27]*zASC27	+_b[ASC28]*zASC28	+_b[ASC29]*zASC29	+_b[ASC30]*zASC30	+_b[ASC31]*zASC31	+_b[ASC32]*zASC32	+_b[ASC33]*zASC33	+_b[ASC34]*zASC34	+_b[ASC35]*zASC35	+_b[ASC36]*zASC36	+_b[ASC37]*zASC37	+_b[ASC38]*zASC38	+_b[ASC39]*zASC39	+_b[ASC40]*zASC40	+_b[ASC41]*zASC41	+_b[ASC44]*zASC44	+_b[ASC47]*zASC47	+_b[ASC48]*zASC48	+_b[ASC49]*zASC49	+_b[ASC50]*zASC50	+_b[ASC52]*zASC52	+_b[ASC53]*zASC53	+_b[ASC54]*zASC54	+_b[ASC55]*zASC55	+_b[ASC56]*zASC56	+_b[ASC59]*zASC59	+_b[ASC60]*zASC60	+_b[ASC61]*zASC61	+_b[ASC62]*zASC62	+_b[ASC63]*zASC63	+_b[ASC64]*zASC64	+_b[ASC65]*zASC65	+_b[ASC66]*zASC66	+_b[ASC67]*zASC67	+_b[ASC68]*zASC68	+_b[ASC69]*zASC69	+_b[ASC70]*zASC70	+_b[ASC71]*zASC71	+_b[ASC72]*zASC72	+_b[ASC73]*zASC73	+_b[ASC74]*zASC74	+_b[ASC75]*zASC75	+_b[ASC76]*zASC76	+_b[ASC78]*zASC78	+_b[ASC79]*zASC79	+_b[ASC80]*zASC80	+_b[ASC81]*zASC81	+_b[ASC82]*zASC82	+_b[ASC84]*zASC84	+_b[ASC85]*zASC85	+_b[ASC86]*zASC86	+_b[ASC88]*zASC88	+_b[ASC89]*zASC89	+_b[ASC90]*zASC90	+_b[ASC91]*zASC91	+_b[ASC92]*zASC92	+_b[ASC93]*zASC93	+_b[ASC94]*zASC94	+_b[ASC95]*zASC95	+_b[ASC96]*zASC96	+_b[ASC98]*zASC98	+_b[ASC99]*zASC99	+_b[ASC100]*zASC100	+_b[ASC101]*zASC101	+_b[ASC102]*zASC102	+_b[ASC103]*zASC103	+_b[ASC104]*zASC104	+_b[ASC105]*zASC105	+_b[ASC106]*zASC106	+_b[ASC107]*zASC107	+_b[ASC109]*zASC109	+_b[ASC111]*zASC111	+_b[ASC112]*zASC112	+_b[ASC113]*zASC113	+_b[ASC114]*zASC114	+_b[ASC115]*zASC115	+_b[ASC116]*zASC116	+_b[ASC118]*zASC118	+_b[ASC120]*zASC120	+_b[ASC121]*zASC121	+_b[ASC122]*zASC122	+_b[ASC123]*zASC123	+_b[ASC124]*zASC124	+_b[ASC125]*zASC125	+_b[ASC127]*zASC127)
																																																																																																																															
cap drop zASC1-zASC127	


local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen bgzASC`i'= ASC`i'
       replace bgzASC`i' = 0 if ASC`i'==1 & (bc==1 | gc==1 | zi==1)
       local i=`i'+1																																																																																																																															
       }	
	   
drop bgzASC42 bgzASC43 bgzASC45 bgzASC46 bgzASC51 bgzASC57 bgzASC58 bgzASC77 bgzASC83 bgzASC87 bgzASC97 bgzASC108 bgzASC110 bgzASC117 bgzASC119 bgzASC126

gen	Avbgz=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*bgzASC16	+_b[ASC2]*bgzASC2	+_b[ASC3]*bgzASC3	+_b[ASC4]*bgzASC4	+_b[ASC5]*bgzASC5	+_b[ASC6]*bgzASC6	+_b[ASC7]*bgzASC7	+_b[ASC8]*bgzASC8	+_b[ASC9]*bgzASC9	+_b[ASC10]*bgzASC10	+_b[ASC11]*bgzASC11	+_b[ASC12]*bgzASC12	+_b[ASC13]*bgzASC13	+_b[ASC14]*bgzASC14	+_b[ASC15]*bgzASC15	+_b[ASC17]*bgzASC17	+_b[ASC18]*bgzASC18	+_b[ASC19]*bgzASC19	+_b[ASC20]*bgzASC20	+_b[ASC21]*bgzASC21	+_b[ASC22]*bgzASC22	+_b[ASC23]*bgzASC23	+_b[ASC24]*bgzASC24	+_b[ASC25]*bgzASC25	+_b[ASC26]*bgzASC26	+_b[ASC27]*bgzASC27	+_b[ASC28]*bgzASC28	+_b[ASC29]*bgzASC29	+_b[ASC30]*bgzASC30	+_b[ASC31]*bgzASC31	+_b[ASC32]*bgzASC32	+_b[ASC33]*bgzASC33	+_b[ASC34]*bgzASC34	+_b[ASC35]*bgzASC35	+_b[ASC36]*bgzASC36	+_b[ASC37]*bgzASC37	+_b[ASC38]*bgzASC38	+_b[ASC39]*bgzASC39	+_b[ASC40]*bgzASC40	+_b[ASC41]*bgzASC41	+_b[ASC44]*bgzASC44	+_b[ASC47]*bgzASC47	+_b[ASC48]*bgzASC48	+_b[ASC49]*bgzASC49	+_b[ASC50]*bgzASC50	+_b[ASC52]*bgzASC52	+_b[ASC53]*bgzASC53	+_b[ASC54]*bgzASC54	+_b[ASC55]*bgzASC55	+_b[ASC56]*bgzASC56	+_b[ASC59]*bgzASC59	+_b[ASC60]*bgzASC60	+_b[ASC61]*bgzASC61	+_b[ASC62]*bgzASC62	+_b[ASC63]*bgzASC63	+_b[ASC64]*bgzASC64	+_b[ASC65]*bgzASC65	+_b[ASC66]*bgzASC66	+_b[ASC67]*bgzASC67	+_b[ASC68]*bgzASC68	+_b[ASC69]*bgzASC69	+_b[ASC70]*bgzASC70	+_b[ASC71]*bgzASC71	+_b[ASC72]*bgzASC72	+_b[ASC73]*bgzASC73	+_b[ASC74]*bgzASC74	+_b[ASC75]*bgzASC75	+_b[ASC76]*bgzASC76	+_b[ASC78]*bgzASC78	+_b[ASC79]*bgzASC79	+_b[ASC80]*bgzASC80	+_b[ASC81]*bgzASC81	+_b[ASC82]*bgzASC82	+_b[ASC84]*bgzASC84	+_b[ASC85]*bgzASC85	+_b[ASC86]*bgzASC86	+_b[ASC88]*bgzASC88	+_b[ASC89]*bgzASC89	+_b[ASC90]*bgzASC90	+_b[ASC91]*bgzASC91	+_b[ASC92]*bgzASC92	+_b[ASC93]*bgzASC93	+_b[ASC94]*bgzASC94	+_b[ASC95]*bgzASC95	+_b[ASC96]*bgzASC96	+_b[ASC98]*bgzASC98	+_b[ASC99]*bgzASC99	+_b[ASC100]*bgzASC100	+_b[ASC101]*bgzASC101	+_b[ASC102]*bgzASC102	+_b[ASC103]*bgzASC103	+_b[ASC104]*bgzASC104	+_b[ASC105]*bgzASC105	+_b[ASC106]*bgzASC106	+_b[ASC107]*bgzASC107	+_b[ASC109]*bgzASC109	+_b[ASC111]*bgzASC111	+_b[ASC112]*bgzASC112	+_b[ASC113]*bgzASC113	+_b[ASC114]*bgzASC114	+_b[ASC115]*bgzASC115	+_b[ASC116]*bgzASC116	+_b[ASC118]*bgzASC118	+_b[ASC120]*bgzASC120	+_b[ASC121]*bgzASC121	+_b[ASC122]*bgzASC122	+_b[ASC123]*bgzASC123	+_b[ASC124]*bgzASC124	+_b[ASC125]*bgzASC125	+_b[ASC127]*bgzASC127)																																																																																																																															
cap drop bgzASC1-bgzASC127	


local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen gpASC`i'= ASC`i'
       replace gpASC`i' = 0 if ASC`i'==1 & (gc==1 | pf==1)
       local i=`i'+1																																																																																																																															
       }		
	   
drop gpASC42 gpASC43 gpASC45 gpASC46 gpASC51 gpASC57 gpASC58 gpASC77 gpASC83 gpASC87 gpASC97 gpASC108 gpASC110 gpASC117 gpASC119 gpASC126

gen	Avgp=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*gpASC16	+_b[ASC2]*gpASC2	+_b[ASC3]*gpASC3	+_b[ASC4]*gpASC4	+_b[ASC5]*gpASC5	+_b[ASC6]*gpASC6	+_b[ASC7]*gpASC7	+_b[ASC8]*gpASC8	+_b[ASC9]*gpASC9	+_b[ASC10]*gpASC10	+_b[ASC11]*gpASC11	+_b[ASC12]*gpASC12	+_b[ASC13]*gpASC13	+_b[ASC14]*gpASC14	+_b[ASC15]*gpASC15	+_b[ASC17]*gpASC17	+_b[ASC18]*gpASC18	+_b[ASC19]*gpASC19	+_b[ASC20]*gpASC20	+_b[ASC21]*gpASC21	+_b[ASC22]*gpASC22	+_b[ASC23]*gpASC23	+_b[ASC24]*gpASC24	+_b[ASC25]*gpASC25	+_b[ASC26]*gpASC26	+_b[ASC27]*gpASC27	+_b[ASC28]*gpASC28	+_b[ASC29]*gpASC29	+_b[ASC30]*gpASC30	+_b[ASC31]*gpASC31	+_b[ASC32]*gpASC32	+_b[ASC33]*gpASC33	+_b[ASC34]*gpASC34	+_b[ASC35]*gpASC35	+_b[ASC36]*gpASC36	+_b[ASC37]*gpASC37	+_b[ASC38]*gpASC38	+_b[ASC39]*gpASC39	+_b[ASC40]*gpASC40	+_b[ASC41]*gpASC41	+_b[ASC44]*gpASC44	+_b[ASC47]*gpASC47	+_b[ASC48]*gpASC48	+_b[ASC49]*gpASC49	+_b[ASC50]*gpASC50	+_b[ASC52]*gpASC52	+_b[ASC53]*gpASC53	+_b[ASC54]*gpASC54	+_b[ASC55]*gpASC55	+_b[ASC56]*gpASC56	+_b[ASC59]*gpASC59	+_b[ASC60]*gpASC60	+_b[ASC61]*gpASC61	+_b[ASC62]*gpASC62	+_b[ASC63]*gpASC63	+_b[ASC64]*gpASC64	+_b[ASC65]*gpASC65	+_b[ASC66]*gpASC66	+_b[ASC67]*gpASC67	+_b[ASC68]*gpASC68	+_b[ASC69]*gpASC69	+_b[ASC70]*gpASC70	+_b[ASC71]*gpASC71	+_b[ASC72]*gpASC72	+_b[ASC73]*gpASC73	+_b[ASC74]*gpASC74	+_b[ASC75]*gpASC75	+_b[ASC76]*gpASC76	+_b[ASC78]*gpASC78	+_b[ASC79]*gpASC79	+_b[ASC80]*gpASC80	+_b[ASC81]*gpASC81	+_b[ASC82]*gpASC82	+_b[ASC84]*gpASC84	+_b[ASC85]*gpASC85	+_b[ASC86]*gpASC86	+_b[ASC88]*gpASC88	+_b[ASC89]*gpASC89	+_b[ASC90]*gpASC90	+_b[ASC91]*gpASC91	+_b[ASC92]*gpASC92	+_b[ASC93]*gpASC93	+_b[ASC94]*gpASC94	+_b[ASC95]*gpASC95	+_b[ASC96]*gpASC96	+_b[ASC98]*gpASC98	+_b[ASC99]*gpASC99	+_b[ASC100]*gpASC100	+_b[ASC101]*gpASC101	+_b[ASC102]*gpASC102	+_b[ASC103]*gpASC103	+_b[ASC104]*gpASC104	+_b[ASC105]*gpASC105	+_b[ASC106]*gpASC106	+_b[ASC107]*gpASC107	+_b[ASC109]*gpASC109	+_b[ASC111]*gpASC111	+_b[ASC112]*gpASC112	+_b[ASC113]*gpASC113	+_b[ASC114]*gpASC114	+_b[ASC115]*gpASC115	+_b[ASC116]*gpASC116	+_b[ASC118]*gpASC118	+_b[ASC120]*gpASC120	+_b[ASC121]*gpASC121	+_b[ASC122]*gpASC122	+_b[ASC123]*gpASC123	+_b[ASC124]*gpASC124	+_b[ASC125]*gpASC125	+_b[ASC127]*gpASC127)
cap drop gpASC1-gpASC127	


local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen acASC`i'= ASC`i'
       replace acASC`i' = 0 if ASC`i'==1 & (ar==1 | ca==1)
       local i=`i'+1																																																																																																																															
       }	
	   
drop acASC42 acASC43 acASC45 acASC46 acASC51 acASC57 acASC58 acASC77 acASC83 acASC87 acASC97 acASC108 acASC110 acASC117 acASC119 acASC126

gen	Avac=	exp(_b[ncost3]*ncost3	+_b[ncflextime3]*ncflextime3	+_b[ncrenter3]*ncrenter3	+_b[ncinc3]*ncinc3	+_b[ASC16]*acASC16	+_b[ASC2]*acASC2	+_b[ASC3]*acASC3	+_b[ASC4]*acASC4	+_b[ASC5]*acASC5	+_b[ASC6]*acASC6	+_b[ASC7]*acASC7	+_b[ASC8]*acASC8	+_b[ASC9]*acASC9	+_b[ASC10]*acASC10	+_b[ASC11]*acASC11	+_b[ASC12]*acASC12	+_b[ASC13]*acASC13	+_b[ASC14]*acASC14	+_b[ASC15]*acASC15	+_b[ASC17]*acASC17	+_b[ASC18]*acASC18	+_b[ASC19]*acASC19	+_b[ASC20]*acASC20	+_b[ASC21]*acASC21	+_b[ASC22]*acASC22	+_b[ASC23]*acASC23	+_b[ASC24]*acASC24	+_b[ASC25]*acASC25	+_b[ASC26]*acASC26	+_b[ASC27]*acASC27	+_b[ASC28]*acASC28	+_b[ASC29]*acASC29	+_b[ASC30]*acASC30	+_b[ASC31]*acASC31	+_b[ASC32]*acASC32	+_b[ASC33]*acASC33	+_b[ASC34]*acASC34	+_b[ASC35]*acASC35	+_b[ASC36]*acASC36	+_b[ASC37]*acASC37	+_b[ASC38]*acASC38	+_b[ASC39]*acASC39	+_b[ASC40]*acASC40	+_b[ASC41]*acASC41	+_b[ASC44]*acASC44	+_b[ASC47]*acASC47	+_b[ASC48]*acASC48	+_b[ASC49]*acASC49	+_b[ASC50]*acASC50	+_b[ASC52]*acASC52	+_b[ASC53]*acASC53	+_b[ASC54]*acASC54	+_b[ASC55]*acASC55	+_b[ASC56]*acASC56	+_b[ASC59]*acASC59	+_b[ASC60]*acASC60	+_b[ASC61]*acASC61	+_b[ASC62]*acASC62	+_b[ASC63]*acASC63	+_b[ASC64]*acASC64	+_b[ASC65]*acASC65	+_b[ASC66]*acASC66	+_b[ASC67]*acASC67	+_b[ASC68]*acASC68	+_b[ASC69]*acASC69	+_b[ASC70]*acASC70	+_b[ASC71]*acASC71	+_b[ASC72]*acASC72	+_b[ASC73]*acASC73	+_b[ASC74]*acASC74	+_b[ASC75]*acASC75	+_b[ASC76]*acASC76	+_b[ASC78]*acASC78	+_b[ASC79]*acASC79	+_b[ASC80]*acASC80	+_b[ASC81]*acASC81	+_b[ASC82]*acASC82	+_b[ASC84]*acASC84	+_b[ASC85]*acASC85	+_b[ASC86]*acASC86	+_b[ASC88]*acASC88	+_b[ASC89]*acASC89	+_b[ASC90]*acASC90	+_b[ASC91]*acASC91	+_b[ASC92]*acASC92	+_b[ASC93]*acASC93	+_b[ASC94]*acASC94	+_b[ASC95]*acASC95	+_b[ASC96]*acASC96	+_b[ASC98]*acASC98	+_b[ASC99]*acASC99	+_b[ASC100]*acASC100	+_b[ASC101]*acASC101	+_b[ASC102]*acASC102	+_b[ASC103]*acASC103	+_b[ASC104]*acASC104	+_b[ASC105]*acASC105	+_b[ASC106]*acASC106	+_b[ASC107]*acASC107	+_b[ASC109]*acASC109	+_b[ASC111]*acASC111	+_b[ASC112]*acASC112	+_b[ASC113]*acASC113	+_b[ASC114]*acASC114	+_b[ASC115]*acASC115	+_b[ASC116]*acASC116	+_b[ASC118]*acASC118	+_b[ASC120]*acASC120	+_b[ASC121]*acASC121	+_b[ASC122]*acASC122	+_b[ASC123]*acASC123	+_b[ASC124]*acASC124	+_b[ASC125]*acASC125	+_b[ASC127]*acASC127)
drop acASC1-acASC127	

cap drop ASC1-ASC127


save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\VEH_ASCforSAS15.dta", replace version(12)




/*******************************127 Welfare Analysis*****************************/
cap drop Avall
gen   Avall= exp(  _b[ncost3]*ncost3     +     _b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*ASC1+_b[ASC2]*ASC2+_b[ASC3]*ASC3 +_b[ASC4]*ASC4 +_b[ASC5]*ASC5 +_b[ASC6]*ASC6 +_b[ASC7]*ASC7 +_b[ASC8]*ASC8 +_b[ASC9]*ASC9 +_b[ASC10]*ASC10 +_b[ASC11]*ASC11 +_b[ASC12]*ASC12 +_b[ASC13]*ASC13 +_b[ASC14]*ASC14 +_b[ASC15]*ASC15 +_b[ASC16]*ASC16	+_b[ASC17]*ASC17 +_b[ASC18]*ASC18 +_b[ASC19]*ASC19 +_b[ASC20]*ASC20 +_b[ASC21]*ASC21 +_b[ASC22]*ASC22 +_b[ASC23]*ASC23 +_b[ASC24]*ASC24 +_b[ASC25]*ASC25 +_b[ASC26]*ASC26 +_b[ASC27]*ASC27 +_b[ASC28]*ASC28 +_b[ASC29]*ASC29 +_b[ASC30]*ASC30 +_b[ASC31]*ASC31 +_b[ASC32]*ASC32 +_b[ASC33]*ASC33 +_b[ASC34]*ASC34+_b[ASC35]* ASC35 +_b[ASC36]*ASC36 +_b[ASC37]*ASC37 +_b[ASC38]*ASC38 +_b[ASC39]*ASC39 +_b[ASC40]*ASC40 +_b[ASC41]*ASC41 +_b[ASC42]*ASC42 +_b[ASC43]*ASC43 +_b[ASC44]*ASC44 +_b[ASC45]*ASC45 +_b[ASC46]*ASC46 +_b[ASC47]*ASC47 +_b[ASC48]*ASC48 +_b[ASC49]*ASC49 +_b[ASC50]*ASC50 +_b[ASC51]*ASC51 +_b[ASC52]*ASC52 +_b[ASC53]*ASC53 +_b[ASC54]*ASC54 +_b[ASC55]*ASC55 +_b[ASC56]*ASC56 +_b[ASC57]*ASC57 +_b[ASC58]*ASC58 +_b[ASC59]*ASC59 +_b[ASC60]*ASC60 +_b[ASC61]*ASC61 +_b[ASC62]*ASC62 +_b[ASC63]*ASC63 +_b[ASC64]*ASC64 +_b[ASC65]*ASC65 +_b[ASC66]*ASC66 +_b[ASC67]*ASC67 +_b[ASC68]*ASC68 +_b[ASC69]*ASC69 +_b[ASC70]*ASC70 +_b[ASC71]*ASC71 +_b[ASC72]*ASC72 +_b[ASC73]*ASC73 +_b[ASC74]*ASC74 +_b[ASC75]*ASC75 +_b[ASC76]*ASC76 +_b[ASC77]*ASC77 +_b[ASC78]*ASC78 +_b[ASC79]*ASC79 +_b[ASC80]*ASC80 +_b[ASC81]*ASC81 +_b[ASC82]*ASC82 +_b[ASC83]*ASC83 +_b[ASC84]*ASC84 +_b[ASC85]*ASC85 +_b[ASC86]*ASC86 +_b[ASC87]*ASC87 +_b[ASC88]*ASC88 +_b[ASC89]*ASC89 +_b[ASC90]*ASC90 +_b[ASC91]*ASC91 +_b[ASC92]*ASC92 +_b[ASC93]*ASC93 +_b[ASC94]*ASC94 +_b[ASC95]*ASC95 +_b[ASC96]*ASC96 +_b[ASC97]*ASC97 +_b[ASC98]*ASC98 +_b[ASC99]*ASC99 +_b[ASC100]*ASC100 +_b[ASC101]*ASC101 +_b[ASC102]*ASC102 +_b[ASC103]*ASC103 +_b[ASC104]*ASC104 +_b[ASC105]*ASC105 +_b[ASC106]*ASC106 +_b[ASC107]*ASC107 +_b[ASC108]*ASC108 +_b[ASC109]*ASC109 +_b[ASC110]*ASC110 +_b[ASC111]*ASC111 +_b[ASC112]*ASC112 +_b[ASC113]*ASC113 +_b[ASC114]*ASC114 +_b[ASC115]*ASC115 +_b[ASC116]*ASC116 +_b[ASC117]*ASC117 +_b[ASC118]*ASC118 +_b[ASC119]*ASC119 +_b[ASC120]*ASC120 +_b[ASC121]*ASC121 +_b[ASC122]*ASC122 +_b[ASC123]*ASC123 +_b[ASC124]*ASC124 +_b[ASC125]*ASC125 +_b[ASC126]*ASC126 +_b[ASC127]*ASC127)																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen aASC`i'= ASC`i'																																																																																																																															
       replace aASC`i' = 0 if ASC`i'==1 & ar==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															

cap drop Avar
gen   Avar=  exp(  _b[ncost3]*ncost3     +	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*aASC1+_b[ASC2]*aASC2+_b[ASC3]*aASC3    +_b[ASC4]*aASC4   +_b[ASC5]*aASC5   +_b[ASC6]*aASC6   +_b[ASC7]*aASC7   +_b[ASC8]*aASC8   +_b[ASC9]*aASC9   +_b[ASC10]*aASC10	+_b[ASC11]*aASC11	+_b[ASC12]*aASC12	+_b[ASC13]*aASC13	+_b[ASC14]*aASC14	+_b[ASC15]*aASC15	+_b[ASC16]*aASC16	+_b[ASC17]*aASC17	+_b[ASC18]*aASC18	+_b[ASC19]*aASC19	+_b[ASC20]*aASC20	+_b[ASC21]*aASC21	+_b[ASC22]*aASC22	+_b[ASC23]*aASC23	+_b[ASC24]*aASC24	+_b[ASC25]*aASC25	+_b[ASC26]*aASC26	+_b[ASC27]*aASC27	+_b[ASC28]*aASC28	+_b[ASC29]*aASC29	+_b[ASC30]*aASC30	+_b[ASC31]*aASC31	+_b[ASC32]*aASC32	+_b[ASC33]*aASC33	+_b[ASC34]*aASC34+_b[ASC35]*	aASC35	+_b[ASC36]*aASC36	+_b[ASC37]*aASC37	+_b[ASC38]*aASC38	+_b[ASC39]*aASC39	+_b[ASC40]*aASC40	+_b[ASC41]*aASC41	+_b[ASC42]*aASC42	+_b[ASC43]*aASC43	+_b[ASC44]*aASC44	+_b[ASC45]*aASC45	+_b[ASC46]*aASC46	+_b[ASC47]*aASC47	+_b[ASC48]*aASC48	+_b[ASC49]*aASC49	+_b[ASC50]*aASC50	+_b[ASC51]*aASC51	+_b[ASC52]*aASC52	+_b[ASC53]*aASC53	+_b[ASC54]*aASC54	+_b[ASC55]*aASC55	+_b[ASC56]*aASC56	+_b[ASC57]*aASC57 +_b[ASC58]*aASC58	+_b[ASC59]*aASC59	+_b[ASC60]*aASC60	+_b[ASC61]*aASC61	+_b[ASC62]*aASC62	+_b[ASC63]*aASC63	+_b[ASC64]*aASC64	+_b[ASC65]*aASC65	+_b[ASC66]*aASC66	+_b[ASC67]*aASC67	+_b[ASC68]*aASC68	+_b[ASC69]*aASC69	+_b[ASC70]*aASC70	+_b[ASC71]*aASC71	+_b[ASC72]*aASC72	+_b[ASC73]*aASC73	+_b[ASC74]*aASC74	+_b[ASC75]*aASC75	+_b[ASC76]*aASC76	+_b[ASC77]*aASC77	+_b[ASC78]*aASC78	+_b[ASC79]*aASC79	+_b[ASC80]*aASC80	+_b[ASC81]*aASC81	+_b[ASC82]*aASC82	+_b[ASC83]*aASC83	+_b[ASC84]*aASC84	+_b[ASC85]*aASC85	+_b[ASC86]*aASC86	+_b[ASC87]*aASC87	+_b[ASC88]*aASC88	+_b[ASC89]*aASC89	+_b[ASC90]*aASC90	+_b[ASC91]*aASC91	+_b[ASC92]*aASC92	+_b[ASC93]*aASC93	+_b[ASC94]*aASC94	+_b[ASC95]*aASC95	+_b[ASC96]*aASC96	+_b[ASC97]*aASC97	+_b[ASC98]*aASC98	+_b[ASC99]*aASC99	+_b[ASC100]*aASC100	+_b[ASC101]*aASC101	+_b[ASC102]*aASC102	+_b[ASC103]*aASC103	+_b[ASC104]*aASC104	+_b[ASC105]*aASC105	+_b[ASC106]*aASC106	+_b[ASC107]*aASC107	+_b[ASC108]*aASC108	+_b[ASC109]*aASC109	+_b[ASC110]*aASC110	+_b[ASC111]*aASC111	+_b[ASC112]*aASC112	+_b[ASC113]*aASC113	+_b[ASC114]*aASC114	+_b[ASC115]*aASC115	+_b[ASC116]*aASC116	+_b[ASC117]*aASC117	+_b[ASC118]*aASC118	+_b[ASC119]*aASC119	+_b[ASC120]*aASC120	+_b[ASC121]*aASC121	+_b[ASC122]*aASC122	+_b[ASC123]*aASC123	+_b[ASC124]*aASC124	+_b[ASC125]*aASC125	+_b[ASC126]*aASC126	+_b[ASC127]*aASC127)											
drop aASC1-aASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen bASC`i'= ASC`i'																																																																																																																															
       replace bASC`i' = 0 if ASC`i'==1 & bc==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avbc=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*bASC1+_b[ASC2]*bASC2+_b[ASC3]*bASC3	+_b[ASC4]*bASC4	+_b[ASC5]*bASC5 	+_b[ASC6]*bASC6	+_b[ASC7]*bASC7	+_b[ASC8]*bASC8	+_b[ASC9]*bASC9	+_b[ASC10]*bASC10	+_b[ASC11]*bASC11	+_b[ASC12]*bASC12	+_b[ASC13]*bASC13	+_b[ASC14]*bASC14	+_b[ASC15]*bASC15	+_b[ASC16]*bASC16	+_b[ASC17]*bASC17	+_b[ASC18]*bASC18	+_b[ASC19]*bASC19	+_b[ASC20]*bASC20	+_b[ASC21]*bASC21	+_b[ASC22]*bASC22	+_b[ASC23]*bASC23	+_b[ASC24]*bASC24	+_b[ASC25]*bASC25	+_b[ASC26]*bASC26	+_b[ASC27]*bASC27	+_b[ASC28]*bASC28	+_b[ASC29]*bASC29	+_b[ASC30]*bASC30	+_b[ASC31]*bASC31	+_b[ASC32]*bASC32	+_b[ASC33]*bASC33	+_b[ASC34]*bASC34+_b[ASC35]*	bASC35	+_b[ASC36]*bASC36	+_b[ASC37]*bASC37	+_b[ASC38]*bASC38	+_b[ASC39]*bASC39	+_b[ASC40]*bASC40	+_b[ASC41]*bASC41	+_b[ASC42]*bASC42	+_b[ASC43]*bASC43	+_b[ASC44]*bASC44	+_b[ASC45]*bASC45	+_b[ASC46]*bASC46	+_b[ASC47]*bASC47	+_b[ASC48]*bASC48	+_b[ASC49]*bASC49	+_b[ASC50]*bASC50	+_b[ASC51]*bASC51	+_b[ASC52]*bASC52	+_b[ASC53]*bASC53	+_b[ASC54]*bASC54	+_b[ASC55]*bASC55	+_b[ASC56]*bASC56	+_b[ASC57]*bASC57 +_b[ASC58]*bASC58	+_b[ASC59]*bASC59	+_b[ASC60]*bASC60	+_b[ASC61]*bASC61	+_b[ASC62]*bASC62	+_b[ASC63]*bASC63	+_b[ASC64]*bASC64	+_b[ASC65]*bASC65	+_b[ASC66]*bASC66	+_b[ASC67]*bASC67	+_b[ASC68]*bASC68	+_b[ASC69]*bASC69	+_b[ASC70]*bASC70	+_b[ASC71]*bASC71	+_b[ASC72]*bASC72	+_b[ASC73]*bASC73	+_b[ASC74]*bASC74	+_b[ASC75]*bASC75	+_b[ASC76]*bASC76	+_b[ASC77]*bASC77	+_b[ASC78]*bASC78	+_b[ASC79]*bASC79	+_b[ASC80]*bASC80	+_b[ASC81]*bASC81	+_b[ASC82]*bASC82	+_b[ASC83]*bASC83	+_b[ASC84]*bASC84	+_b[ASC85]*bASC85	+_b[ASC86]*bASC86	+_b[ASC87]*bASC87	+_b[ASC88]*bASC88	+_b[ASC89]*bASC89	+_b[ASC90]*bASC90	+_b[ASC91]*bASC91	+_b[ASC92]*bASC92	+_b[ASC93]*bASC93	+_b[ASC94]*bASC94	+_b[ASC95]*bASC95	+_b[ASC96]*bASC96	+_b[ASC97]*bASC97	+_b[ASC98]*bASC98	+_b[ASC99]*bASC99	+_b[ASC100]*bASC100	+_b[ASC101]*bASC101	+_b[ASC102]*bASC102	+_b[ASC103]*bASC103	+_b[ASC104]*bASC104	+_b[ASC105]*bASC105	+_b[ASC106]*bASC106	+_b[ASC107]*bASC107	+_b[ASC108]*bASC108	+_b[ASC109]*bASC109	+_b[ASC110]*bASC110	+_b[ASC111]*bASC111	+_b[ASC112]*bASC112	+_b[ASC113]*bASC113	+_b[ASC114]*bASC114	+_b[ASC115]*bASC115	+_b[ASC116]*bASC116	+_b[ASC117]*bASC117	+_b[ASC118]*bASC118	+_b[ASC119]*bASC119	+_b[ASC120]*bASC120	+_b[ASC121]*bASC121	+_b[ASC122]*bASC122	+_b[ASC123]*bASC123	+_b[ASC124]*bASC124	+_b[ASC125]*bASC125	+_b[ASC126]*bASC126	+_b[ASC127]*bASC127)
drop bASC1-bASC127																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen cASC`i'= ASC`i'																																																																																																																															
       replace cASC`i' = 0 if ASC`i'==1 & ca==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avca=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*cASC1+_b[ASC2]*cASC2+_b[ASC3]*cASC3	+_b[ASC4]*cASC4	+_b[ASC5]*cASC5	+_b[ASC6]*cASC6	+_b[ASC7]*cASC7	+_b[ASC8]*cASC8	+_b[ASC9]*cASC9	+_b[ASC10]*cASC10	+_b[ASC11]*cASC11	+_b[ASC12]*cASC12	+_b[ASC13]*cASC13	+_b[ASC14]*cASC14	+_b[ASC15]*cASC15	+_b[ASC16]*cASC16	+_b[ASC17]*cASC17	+_b[ASC18]*cASC18	+_b[ASC19]*cASC19	+_b[ASC20]*cASC20	+_b[ASC21]*cASC21	+_b[ASC22]*cASC22	+_b[ASC23]*cASC23	+_b[ASC24]*cASC24	+_b[ASC25]*cASC25	+_b[ASC26]*cASC26	+_b[ASC27]*cASC27	+_b[ASC28]*cASC28	+_b[ASC29]*cASC29	+_b[ASC30]*cASC30	+_b[ASC31]*cASC31	+_b[ASC32]*cASC32	+_b[ASC33]*cASC33	+_b[ASC34]*cASC34+_b[ASC35]*	cASC35	+_b[ASC36]*cASC36	+_b[ASC37]*cASC37	+_b[ASC38]*cASC38	+_b[ASC39]*cASC39	+_b[ASC40]*cASC40	+_b[ASC41]*cASC41	+_b[ASC42]*cASC42	+_b[ASC43]*cASC43	+_b[ASC44]*cASC44	+_b[ASC45]*cASC45	+_b[ASC46]*cASC46	+_b[ASC47]*cASC47	+_b[ASC48]*cASC48	+_b[ASC49]*cASC49	+_b[ASC50]*cASC50	+_b[ASC51]*cASC51	+_b[ASC52]*cASC52	+_b[ASC53]*cASC53	+_b[ASC54]*cASC54	+_b[ASC55]*cASC55	+_b[ASC56]*cASC56	+_b[ASC57]*cASC57 +_b[ASC58]*cASC58	+_b[ASC59]*cASC59	+_b[ASC60]*cASC60	+_b[ASC61]*cASC61	+_b[ASC62]*cASC62	+_b[ASC63]*cASC63	+_b[ASC64]*cASC64	+_b[ASC65]*cASC65	+_b[ASC66]*cASC66	+_b[ASC67]*cASC67	+_b[ASC68]*cASC68	+_b[ASC69]*cASC69	+_b[ASC70]*cASC70	+_b[ASC71]*cASC71	+_b[ASC72]*cASC72	+_b[ASC73]*cASC73	+_b[ASC74]*cASC74	+_b[ASC75]*cASC75	+_b[ASC76]*cASC76	+_b[ASC77]*cASC77	+_b[ASC78]*cASC78	+_b[ASC79]*cASC79	+_b[ASC80]*cASC80	+_b[ASC81]*cASC81	+_b[ASC82]*cASC82	+_b[ASC83]*cASC83	+_b[ASC84]*cASC84	+_b[ASC85]*cASC85	+_b[ASC86]*cASC86	+_b[ASC87]*cASC87	+_b[ASC88]*cASC88	+_b[ASC89]*cASC89	+_b[ASC90]*cASC90	+_b[ASC91]*cASC91	+_b[ASC92]*cASC92	+_b[ASC93]*cASC93	+_b[ASC94]*cASC94	+_b[ASC95]*cASC95	+_b[ASC96]*cASC96	+_b[ASC97]*cASC97	+_b[ASC98]*cASC98	+_b[ASC99]*cASC99	+_b[ASC100]*cASC100	+_b[ASC101]*cASC101	+_b[ASC102]*cASC102	+_b[ASC103]*cASC103	+_b[ASC104]*cASC104	+_b[ASC105]*cASC105	+_b[ASC106]*cASC106	+_b[ASC107]*cASC107	+_b[ASC108]*cASC108	+_b[ASC109]*cASC109	+_b[ASC110]*cASC110	+_b[ASC111]*cASC111	+_b[ASC112]*cASC112	+_b[ASC113]*cASC113	+_b[ASC114]*cASC114	+_b[ASC115]*cASC115	+_b[ASC116]*cASC116	+_b[ASC117]*cASC117	+_b[ASC118]*cASC118	+_b[ASC119]*cASC119	+_b[ASC120]*cASC120	+_b[ASC121]*cASC121	+_b[ASC122]*cASC122	+_b[ASC123]*cASC123	+_b[ASC124]*cASC124	+_b[ASC125]*cASC125	+_b[ASC126]*cASC126	+_b[ASC127]*cASC127)
																																																																																																																															
drop cASC1-cASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen gASC`i'= ASC`i'																																																																																																																															
       replace gASC`i' = 0 if ASC`i'==1 & gc==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avgc=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*gASC1+_b[ASC2]*gASC2+_b[ASC3]*gASC3	+_b[ASC4]*gASC4	+_b[ASC5]*gASC5	+_b[ASC6]*gASC6	+_b[ASC7]*gASC7	+_b[ASC8]*gASC8	+_b[ASC9]*gASC9	+_b[ASC10]*gASC10	+_b[ASC11]*gASC11	+_b[ASC12]*gASC12	+_b[ASC13]*gASC13	+_b[ASC14]*gASC14	+_b[ASC15]*gASC15	+_b[ASC16]*gASC16	+_b[ASC17]*gASC17	+_b[ASC18]*gASC18	+_b[ASC19]*gASC19	+_b[ASC20]*gASC20	+_b[ASC21]*gASC21	+_b[ASC22]*gASC22	+_b[ASC23]*gASC23	+_b[ASC24]*gASC24	+_b[ASC25]*gASC25	+_b[ASC26]*gASC26	+_b[ASC27]*gASC27	+_b[ASC28]*gASC28	+_b[ASC29]*gASC29	+_b[ASC30]*gASC30	+_b[ASC31]*gASC31	+_b[ASC32]*gASC32	+_b[ASC33]*gASC33	+_b[ASC34]*gASC34+_b[ASC35]*	gASC35	+_b[ASC36]*gASC36	+_b[ASC37]*gASC37	+_b[ASC38]*gASC38	+_b[ASC39]*gASC39	+_b[ASC40]*gASC40	+_b[ASC41]*gASC41	+_b[ASC42]*gASC42	+_b[ASC43]*gASC43	+_b[ASC44]*gASC44	+_b[ASC45]*gASC45	+_b[ASC46]*gASC46	+_b[ASC47]*gASC47	+_b[ASC48]*gASC48	+_b[ASC49]*gASC49	+_b[ASC50]*gASC50	+_b[ASC51]*gASC51	+_b[ASC52]*gASC52	+_b[ASC53]*gASC53	+_b[ASC54]*gASC54	+_b[ASC55]*gASC55	+_b[ASC56]*gASC56	+_b[ASC57]*gASC57 +_b[ASC58]*gASC58	+_b[ASC59]*gASC59	+_b[ASC60]*gASC60	+_b[ASC61]*gASC61	+_b[ASC62]*gASC62	+_b[ASC63]*gASC63	+_b[ASC64]*gASC64	+_b[ASC65]*gASC65	+_b[ASC66]*gASC66	+_b[ASC67]*gASC67	+_b[ASC68]*gASC68	+_b[ASC69]*gASC69	+_b[ASC70]*gASC70	+_b[ASC71]*gASC71	+_b[ASC72]*gASC72	+_b[ASC73]*gASC73	+_b[ASC74]*gASC74	+_b[ASC75]*gASC75	+_b[ASC76]*gASC76	+_b[ASC77]*gASC77	+_b[ASC78]*gASC78	+_b[ASC79]*gASC79	+_b[ASC80]*gASC80	+_b[ASC81]*gASC81	+_b[ASC82]*gASC82	+_b[ASC83]*gASC83	+_b[ASC84]*gASC84	+_b[ASC85]*gASC85	+_b[ASC86]*gASC86	+_b[ASC87]*gASC87	+_b[ASC88]*gASC88	+_b[ASC89]*gASC89	+_b[ASC90]*gASC90	+_b[ASC91]*gASC91	+_b[ASC92]*gASC92	+_b[ASC93]*gASC93	+_b[ASC94]*gASC94	+_b[ASC95]*gASC95	+_b[ASC96]*gASC96	+_b[ASC97]*gASC97	+_b[ASC98]*gASC98	+_b[ASC99]*gASC99	+_b[ASC100]*gASC100	+_b[ASC101]*gASC101	+_b[ASC102]*gASC102	+_b[ASC103]*gASC103	+_b[ASC104]*gASC104	+_b[ASC105]*gASC105	+_b[ASC106]*gASC106	+_b[ASC107]*gASC107	+_b[ASC108]*gASC108	+_b[ASC109]*gASC109	+_b[ASC110]*gASC110	+_b[ASC111]*gASC111	+_b[ASC112]*gASC112	+_b[ASC113]*gASC113	+_b[ASC114]*gASC114	+_b[ASC115]*gASC115	+_b[ASC116]*gASC116	+_b[ASC117]*gASC117	+_b[ASC118]*gASC118	+_b[ASC119]*gASC119	+_b[ASC120]*gASC120	+_b[ASC121]*gASC121	+_b[ASC122]*gASC122	+_b[ASC123]*gASC123	+_b[ASC124]*gASC124	+_b[ASC125]*gASC125	+_b[ASC126]*gASC126	+_b[ASC127]*gASC127)
																																																																																																																															
drop gASC1-gASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen mASC`i'= ASC`i'																																																																																																																															
       replace mASC`i' = 0 if ASC`i'==1 & mv==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avmv=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*mASC1+_b[ASC2]*mASC2+_b[ASC3]*mASC3	+_b[ASC4]*mASC4	+_b[ASC5]*mASC5	+_b[ASC6]*mASC6	+_b[ASC7]*mASC7	+_b[ASC8]*mASC8	+_b[ASC9]*mASC9	+_b[ASC10]*mASC10	+_b[ASC11]*mASC11	+_b[ASC12]*mASC12	+_b[ASC13]*mASC13	+_b[ASC14]*mASC14	+_b[ASC15]*mASC15	+_b[ASC16]*mASC16	+_b[ASC17]*mASC17	+_b[ASC18]*mASC18	+_b[ASC19]*mASC19	+_b[ASC20]*mASC20	+_b[ASC21]*mASC21	+_b[ASC22]*mASC22	+_b[ASC23]*mASC23	+_b[ASC24]*mASC24	+_b[ASC25]*mASC25	+_b[ASC26]*mASC26	+_b[ASC27]*mASC27	+_b[ASC28]*mASC28	+_b[ASC29]*mASC29	+_b[ASC30]*mASC30	+_b[ASC31]*mASC31	+_b[ASC32]*mASC32	+_b[ASC33]*mASC33	+_b[ASC34]*mASC34+_b[ASC35]*	mASC35	+_b[ASC36]*mASC36	+_b[ASC37]*mASC37	+_b[ASC38]*mASC38	+_b[ASC39]*mASC39	+_b[ASC40]*mASC40	+_b[ASC41]*mASC41	+_b[ASC42]*mASC42	+_b[ASC43]*mASC43	+_b[ASC44]*mASC44	+_b[ASC45]*mASC45	+_b[ASC46]*mASC46	+_b[ASC47]*mASC47	+_b[ASC48]*mASC48	+_b[ASC49]*mASC49	+_b[ASC50]*mASC50	+_b[ASC51]*mASC51	+_b[ASC52]*mASC52	+_b[ASC53]*mASC53	+_b[ASC54]*mASC54	+_b[ASC55]*mASC55	+_b[ASC56]*mASC56	+_b[ASC57]*mASC57 +_b[ASC58]*mASC58	+_b[ASC59]*mASC59	+_b[ASC60]*mASC60	+_b[ASC61]*mASC61	+_b[ASC62]*mASC62	+_b[ASC63]*mASC63	+_b[ASC64]*mASC64	+_b[ASC65]*mASC65	+_b[ASC66]*mASC66	+_b[ASC67]*mASC67	+_b[ASC68]*mASC68	+_b[ASC69]*mASC69	+_b[ASC70]*mASC70	+_b[ASC71]*mASC71	+_b[ASC72]*mASC72	+_b[ASC73]*mASC73	+_b[ASC74]*mASC74	+_b[ASC75]*mASC75	+_b[ASC76]*mASC76	+_b[ASC77]*mASC77	+_b[ASC78]*mASC78	+_b[ASC79]*mASC79	+_b[ASC80]*mASC80	+_b[ASC81]*mASC81	+_b[ASC82]*mASC82	+_b[ASC83]*mASC83	+_b[ASC84]*mASC84	+_b[ASC85]*mASC85	+_b[ASC86]*mASC86	+_b[ASC87]*mASC87	+_b[ASC88]*mASC88	+_b[ASC89]*mASC89	+_b[ASC90]*mASC90	+_b[ASC91]*mASC91	+_b[ASC92]*mASC92	+_b[ASC93]*mASC93	+_b[ASC94]*mASC94	+_b[ASC95]*mASC95	+_b[ASC96]*mASC96	+_b[ASC97]*mASC97	+_b[ASC98]*mASC98	+_b[ASC99]*mASC99	+_b[ASC100]*mASC100	+_b[ASC101]*mASC101	+_b[ASC102]*mASC102	+_b[ASC103]*mASC103	+_b[ASC104]*mASC104	+_b[ASC105]*mASC105	+_b[ASC106]*mASC106	+_b[ASC107]*mASC107	+_b[ASC108]*mASC108	+_b[ASC109]*mASC109	+_b[ASC110]*mASC110	+_b[ASC111]*mASC111	+_b[ASC112]*mASC112	+_b[ASC113]*mASC113	+_b[ASC114]*mASC114	+_b[ASC115]*mASC115	+_b[ASC116]*mASC116	+_b[ASC117]*mASC117	+_b[ASC118]*mASC118	+_b[ASC119]*mASC119	+_b[ASC120]*mASC120	+_b[ASC121]*mASC121	+_b[ASC122]*mASC122	+_b[ASC123]*mASC123	+_b[ASC124]*mASC124	+_b[ASC125]*mASC125	+_b[ASC126]*mASC126	+_b[ASC127]*mASC127)
																																																																																																																															
drop mASC1-mASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen pASC`i'= ASC`i'																																																																																																																															
       replace pASC`i' = 0 if ASC`i'==1 & pf==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avpf=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*pASC1+_b[ASC2]*pASC2+_b[ASC3]*pASC3	+_b[ASC4]*pASC4	+_b[ASC5]*pASC5	+_b[ASC6]*pASC6	+_b[ASC7]*pASC7	+_b[ASC8]*pASC8	+_b[ASC9]*pASC9	+_b[ASC10]*pASC10	+_b[ASC11]*pASC11	+_b[ASC12]*pASC12	+_b[ASC13]*pASC13	+_b[ASC14]*pASC14	+_b[ASC15]*pASC15	+_b[ASC16]*pASC16	+_b[ASC17]*pASC17	+_b[ASC18]*pASC18	+_b[ASC19]*pASC19	+_b[ASC20]*pASC20	+_b[ASC21]*pASC21	+_b[ASC22]*pASC22	+_b[ASC23]*pASC23	+_b[ASC24]*pASC24	+_b[ASC25]*pASC25	+_b[ASC26]*pASC26	+_b[ASC27]*pASC27	+_b[ASC28]*pASC28	+_b[ASC29]*pASC29	+_b[ASC30]*pASC30	+_b[ASC31]*pASC31	+_b[ASC32]*pASC32	+_b[ASC33]*pASC33	+_b[ASC34]*pASC34+_b[ASC35]*	pASC35	+_b[ASC36]*pASC36	+_b[ASC37]*pASC37	+_b[ASC38]*pASC38	+_b[ASC39]*pASC39	+_b[ASC40]*pASC40	+_b[ASC41]*pASC41	+_b[ASC42]*pASC42	+_b[ASC43]*pASC43	+_b[ASC44]*pASC44	+_b[ASC45]*pASC45	+_b[ASC46]*pASC46	+_b[ASC47]*pASC47	+_b[ASC48]*pASC48	+_b[ASC49]*pASC49	+_b[ASC50]*pASC50	+_b[ASC51]*pASC51	+_b[ASC52]*pASC52	+_b[ASC53]*pASC53	+_b[ASC54]*pASC54	+_b[ASC55]*pASC55	+_b[ASC56]*pASC56	+_b[ASC57]*pASC57 +_b[ASC58]*pASC58	+_b[ASC59]*pASC59	+_b[ASC60]*pASC60	+_b[ASC61]*pASC61	+_b[ASC62]*pASC62	+_b[ASC63]*pASC63	+_b[ASC64]*pASC64	+_b[ASC65]*pASC65	+_b[ASC66]*pASC66	+_b[ASC67]*pASC67	+_b[ASC68]*pASC68	+_b[ASC69]*pASC69	+_b[ASC70]*pASC70	+_b[ASC71]*pASC71	+_b[ASC72]*pASC72	+_b[ASC73]*pASC73	+_b[ASC74]*pASC74	+_b[ASC75]*pASC75	+_b[ASC76]*pASC76	+_b[ASC77]*pASC77	+_b[ASC78]*pASC78	+_b[ASC79]*pASC79	+_b[ASC80]*pASC80	+_b[ASC81]*pASC81	+_b[ASC82]*pASC82	+_b[ASC83]*pASC83	+_b[ASC84]*pASC84	+_b[ASC85]*pASC85	+_b[ASC86]*pASC86	+_b[ASC87]*pASC87	+_b[ASC88]*pASC88	+_b[ASC89]*pASC89	+_b[ASC90]*pASC90	+_b[ASC91]*pASC91	+_b[ASC92]*pASC92	+_b[ASC93]*pASC93	+_b[ASC94]*pASC94	+_b[ASC95]*pASC95	+_b[ASC96]*pASC96	+_b[ASC97]*pASC97	+_b[ASC98]*pASC98	+_b[ASC99]*pASC99	+_b[ASC100]*pASC100	+_b[ASC101]*pASC101	+_b[ASC102]*pASC102	+_b[ASC103]*pASC103	+_b[ASC104]*pASC104	+_b[ASC105]*pASC105	+_b[ASC106]*pASC106	+_b[ASC107]*pASC107	+_b[ASC108]*pASC108	+_b[ASC109]*pASC109	+_b[ASC110]*pASC110	+_b[ASC111]*pASC111	+_b[ASC112]*pASC112	+_b[ASC113]*pASC113	+_b[ASC114]*pASC114	+_b[ASC115]*pASC115	+_b[ASC116]*pASC116	+_b[ASC117]*pASC117	+_b[ASC118]*pASC118	+_b[ASC119]*pASC119	+_b[ASC120]*pASC120	+_b[ASC121]*pASC121	+_b[ASC122]*pASC122	+_b[ASC123]*pASC123	+_b[ASC124]*pASC124	+_b[ASC125]*pASC125	+_b[ASC126]*pASC126	+_b[ASC127]*pASC127)
																																																																																																																															
drop pASC1-pASC127																																																																																																																															
																																																																																																																															
																																																																																																																															
local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen zASC`i'= ASC`i'																																																																																																																															
       replace zASC`i' = 0 if ASC`i'==1 & zi==1																																																																																																																															
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avzi=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*zASC1+_b[ASC2]*zASC2+_b[ASC3]*zASC3	+_b[ASC4]*zASC4	+_b[ASC5]*zASC5	+_b[ASC6]*zASC6	+_b[ASC7]*zASC7	+_b[ASC8]*zASC8	+_b[ASC9]*zASC9	+_b[ASC10]*zASC10	+_b[ASC11]*zASC11	+_b[ASC12]*zASC12	+_b[ASC13]*zASC13	+_b[ASC14]*zASC14	+_b[ASC15]*zASC15	+_b[ASC16]*zASC16	+_b[ASC17]*zASC17	+_b[ASC18]*zASC18	+_b[ASC19]*zASC19	+_b[ASC20]*zASC20	+_b[ASC21]*zASC21	+_b[ASC22]*zASC22	+_b[ASC23]*zASC23	+_b[ASC24]*zASC24	+_b[ASC25]*zASC25	+_b[ASC26]*zASC26	+_b[ASC27]*zASC27	+_b[ASC28]*zASC28	+_b[ASC29]*zASC29	+_b[ASC30]*zASC30	+_b[ASC31]*zASC31	+_b[ASC32]*zASC32	+_b[ASC33]*zASC33	+_b[ASC34]*zASC34+_b[ASC35]*	zASC35	+_b[ASC36]*zASC36	+_b[ASC37]*zASC37	+_b[ASC38]*zASC38	+_b[ASC39]*zASC39	+_b[ASC40]*zASC40	+_b[ASC41]*zASC41	+_b[ASC42]*zASC42	+_b[ASC43]*zASC43	+_b[ASC44]*zASC44	+_b[ASC45]*zASC45	+_b[ASC46]*zASC46	+_b[ASC47]*zASC47	+_b[ASC48]*zASC48	+_b[ASC49]*zASC49	+_b[ASC50]*zASC50	+_b[ASC51]*zASC51	+_b[ASC52]*zASC52	+_b[ASC53]*zASC53	+_b[ASC54]*zASC54	+_b[ASC55]*zASC55	+_b[ASC56]*zASC56	+_b[ASC57]*zASC57 +_b[ASC58]*zASC58	+_b[ASC59]*zASC59	+_b[ASC60]*zASC60	+_b[ASC61]*zASC61	+_b[ASC62]*zASC62	+_b[ASC63]*zASC63	+_b[ASC64]*zASC64	+_b[ASC65]*zASC65	+_b[ASC66]*zASC66	+_b[ASC67]*zASC67	+_b[ASC68]*zASC68	+_b[ASC69]*zASC69	+_b[ASC70]*zASC70	+_b[ASC71]*zASC71	+_b[ASC72]*zASC72	+_b[ASC73]*zASC73	+_b[ASC74]*zASC74	+_b[ASC75]*zASC75	+_b[ASC76]*zASC76	+_b[ASC77]*zASC77	+_b[ASC78]*zASC78	+_b[ASC79]*zASC79	+_b[ASC80]*zASC80	+_b[ASC81]*zASC81	+_b[ASC82]*zASC82	+_b[ASC83]*zASC83	+_b[ASC84]*zASC84	+_b[ASC85]*zASC85	+_b[ASC86]*zASC86	+_b[ASC87]*zASC87	+_b[ASC88]*zASC88	+_b[ASC89]*zASC89	+_b[ASC90]*zASC90	+_b[ASC91]*zASC91	+_b[ASC92]*zASC92	+_b[ASC93]*zASC93	+_b[ASC94]*zASC94	+_b[ASC95]*zASC95	+_b[ASC96]*zASC96	+_b[ASC97]*zASC97	+_b[ASC98]*zASC98	+_b[ASC99]*zASC99	+_b[ASC100]*zASC100	+_b[ASC101]*zASC101	+_b[ASC102]*zASC102	+_b[ASC103]*zASC103	+_b[ASC104]*zASC104	+_b[ASC105]*zASC105	+_b[ASC106]*zASC106	+_b[ASC107]*zASC107	+_b[ASC108]*zASC108	+_b[ASC109]*zASC109	+_b[ASC110]*zASC110	+_b[ASC111]*zASC111	+_b[ASC112]*zASC112	+_b[ASC113]*zASC113	+_b[ASC114]*zASC114	+_b[ASC115]*zASC115	+_b[ASC116]*zASC116	+_b[ASC117]*zASC117	+_b[ASC118]*zASC118	+_b[ASC119]*zASC119	+_b[ASC120]*zASC120	+_b[ASC121]*zASC121	+_b[ASC122]*zASC122	+_b[ASC123]*zASC123	+_b[ASC124]*zASC124	+_b[ASC125]*zASC125	+_b[ASC126]*zASC126	+_b[ASC127]*zASC127)
																																																																																																																															
drop zASC1-zASC127	


local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen bgzASC`i'= ASC`i'
       replace bgzASC`i' = 0 if ASC`i'==1 & (bc==1 | gc==1 | zi==1)
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avbgz=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*bgzASC1+_b[ASC2]*bgzASC2+_b[ASC3]*bgzASC3	+_b[ASC4]*bgzASC4	+_b[ASC5]*bgzASC5	+_b[ASC6]*bgzASC6	+_b[ASC7]*bgzASC7	+_b[ASC8]*bgzASC8	+_b[ASC9]*bgzASC9	+_b[ASC10]*bgzASC10	+_b[ASC11]*bgzASC11	+_b[ASC12]*bgzASC12	+_b[ASC13]*bgzASC13	+_b[ASC14]*bgzASC14	+_b[ASC15]*bgzASC15	+_b[ASC16]*bgzASC16	+_b[ASC17]*bgzASC17	+_b[ASC18]*bgzASC18	+_b[ASC19]*bgzASC19	+_b[ASC20]*bgzASC20	+_b[ASC21]*bgzASC21	+_b[ASC22]*bgzASC22	+_b[ASC23]*bgzASC23	+_b[ASC24]*bgzASC24	+_b[ASC25]*bgzASC25	+_b[ASC26]*bgzASC26	+_b[ASC27]*bgzASC27	+_b[ASC28]*bgzASC28	+_b[ASC29]*bgzASC29	+_b[ASC30]*bgzASC30	+_b[ASC31]*bgzASC31	+_b[ASC32]*bgzASC32	+_b[ASC33]*bgzASC33	+_b[ASC34]*bgzASC34+_b[ASC35]*	bgzASC35	+_b[ASC36]*bgzASC36	+_b[ASC37]*bgzASC37	+_b[ASC38]*bgzASC38	+_b[ASC39]*bgzASC39	+_b[ASC40]*bgzASC40	+_b[ASC41]*bgzASC41	+_b[ASC42]*bgzASC42	+_b[ASC43]*bgzASC43	+_b[ASC44]*bgzASC44	+_b[ASC45]*bgzASC45	+_b[ASC46]*bgzASC46	+_b[ASC47]*bgzASC47	+_b[ASC48]*bgzASC48	+_b[ASC49]*bgzASC49	+_b[ASC50]*bgzASC50	+_b[ASC51]*bgzASC51	+_b[ASC52]*bgzASC52	+_b[ASC53]*bgzASC53	+_b[ASC54]*bgzASC54	+_b[ASC55]*bgzASC55	+_b[ASC56]*bgzASC56	+_b[ASC57]*bgzASC57 +_b[ASC58]*bgzASC58	+_b[ASC59]*bgzASC59	+_b[ASC60]*bgzASC60	+_b[ASC61]*bgzASC61	+_b[ASC62]*bgzASC62	+_b[ASC63]*bgzASC63	+_b[ASC64]*bgzASC64	+_b[ASC65]*bgzASC65	+_b[ASC66]*bgzASC66	+_b[ASC67]*bgzASC67	+_b[ASC68]*bgzASC68	+_b[ASC69]*bgzASC69	+_b[ASC70]*bgzASC70	+_b[ASC71]*bgzASC71	+_b[ASC72]*bgzASC72	+_b[ASC73]*bgzASC73	+_b[ASC74]*bgzASC74	+_b[ASC75]*bgzASC75	+_b[ASC76]*bgzASC76	+_b[ASC77]*bgzASC77	+_b[ASC78]*bgzASC78	+_b[ASC79]*bgzASC79	+_b[ASC80]*bgzASC80	+_b[ASC81]*bgzASC81	+_b[ASC82]*bgzASC82	+_b[ASC83]*bgzASC83	+_b[ASC84]*bgzASC84	+_b[ASC85]*bgzASC85	+_b[ASC86]*bgzASC86	+_b[ASC87]*bgzASC87	+_b[ASC88]*bgzASC88	+_b[ASC89]*bgzASC89	+_b[ASC90]*bgzASC90	+_b[ASC91]*bgzASC91	+_b[ASC92]*bgzASC92	+_b[ASC93]*bgzASC93	+_b[ASC94]*bgzASC94	+_b[ASC95]*bgzASC95	+_b[ASC96]*bgzASC96	+_b[ASC97]*bgzASC97	+_b[ASC98]*bgzASC98	+_b[ASC99]*bgzASC99	+_b[ASC100]*bgzASC100	+_b[ASC101]*bgzASC101	+_b[ASC102]*bgzASC102	+_b[ASC103]*bgzASC103	+_b[ASC104]*bgzASC104	+_b[ASC105]*bgzASC105	+_b[ASC106]*bgzASC106	+_b[ASC107]*bgzASC107	+_b[ASC108]*bgzASC108	+_b[ASC109]*bgzASC109	+_b[ASC110]*bgzASC110	+_b[ASC111]*bgzASC111	+_b[ASC112]*bgzASC112	+_b[ASC113]*bgzASC113	+_b[ASC114]*bgzASC114	+_b[ASC115]*bgzASC115	+_b[ASC116]*bgzASC116	+_b[ASC117]*bgzASC117	+_b[ASC118]*bgzASC118	+_b[ASC119]*bgzASC119	+_b[ASC120]*bgzASC120	+_b[ASC121]*bgzASC121	+_b[ASC122]*bgzASC122	+_b[ASC123]*bgzASC123	+_b[ASC124]*bgzASC124	+_b[ASC125]*bgzASC125	+_b[ASC126]*bgzASC126	+_b[ASC127]*bgzASC127)																																																																																																																															
drop bgzASC1-bgzASC127	


local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen gpASC`i'= ASC`i'
       replace gpASC`i' = 0 if ASC`i'==1 & (gc==1 | pf==1)
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avgp=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*gpASC1+_b[ASC2]*gpASC2+_b[ASC3]*gpASC3	+_b[ASC4]*gpASC4	+_b[ASC5]*gpASC5	+_b[ASC6]*gpASC6	+_b[ASC7]*gpASC7	+_b[ASC8]*gpASC8	+_b[ASC9]*gpASC9	+_b[ASC10]*gpASC10	+_b[ASC11]*gpASC11	+_b[ASC12]*gpASC12	+_b[ASC13]*gpASC13	+_b[ASC14]*gpASC14	+_b[ASC15]*gpASC15	+_b[ASC16]*gpASC16	+_b[ASC17]*gpASC17	+_b[ASC18]*gpASC18	+_b[ASC19]*gpASC19	+_b[ASC20]*gpASC20	+_b[ASC21]*gpASC21	+_b[ASC22]*gpASC22	+_b[ASC23]*gpASC23	+_b[ASC24]*gpASC24	+_b[ASC25]*gpASC25	+_b[ASC26]*gpASC26	+_b[ASC27]*gpASC27	+_b[ASC28]*gpASC28	+_b[ASC29]*gpASC29	+_b[ASC30]*gpASC30	+_b[ASC31]*gpASC31	+_b[ASC32]*gpASC32	+_b[ASC33]*gpASC33	+_b[ASC34]*gpASC34+_b[ASC35]*	gpASC35	+_b[ASC36]*gpASC36	+_b[ASC37]*gpASC37	+_b[ASC38]*gpASC38	+_b[ASC39]*gpASC39	+_b[ASC40]*gpASC40	+_b[ASC41]*gpASC41	+_b[ASC42]*gpASC42	+_b[ASC43]*gpASC43	+_b[ASC44]*gpASC44	+_b[ASC45]*gpASC45	+_b[ASC46]*gpASC46	+_b[ASC47]*gpASC47	+_b[ASC48]*gpASC48	+_b[ASC49]*gpASC49	+_b[ASC50]*gpASC50	+_b[ASC51]*gpASC51	+_b[ASC52]*gpASC52	+_b[ASC53]*gpASC53	+_b[ASC54]*gpASC54	+_b[ASC55]*gpASC55	+_b[ASC56]*gpASC56	+_b[ASC57]*gpASC57 +_b[ASC58]*gpASC58	+_b[ASC59]*gpASC59	+_b[ASC60]*gpASC60	+_b[ASC61]*gpASC61	+_b[ASC62]*gpASC62	+_b[ASC63]*gpASC63	+_b[ASC64]*gpASC64	+_b[ASC65]*gpASC65	+_b[ASC66]*gpASC66	+_b[ASC67]*gpASC67	+_b[ASC68]*gpASC68	+_b[ASC69]*gpASC69	+_b[ASC70]*gpASC70	+_b[ASC71]*gpASC71	+_b[ASC72]*gpASC72	+_b[ASC73]*gpASC73	+_b[ASC74]*gpASC74	+_b[ASC75]*gpASC75	+_b[ASC76]*gpASC76	+_b[ASC77]*gpASC77	+_b[ASC78]*gpASC78	+_b[ASC79]*gpASC79	+_b[ASC80]*gpASC80	+_b[ASC81]*gpASC81	+_b[ASC82]*gpASC82	+_b[ASC83]*gpASC83	+_b[ASC84]*gpASC84	+_b[ASC85]*gpASC85	+_b[ASC86]*gpASC86	+_b[ASC87]*gpASC87	+_b[ASC88]*gpASC88	+_b[ASC89]*gpASC89	+_b[ASC90]*gpASC90	+_b[ASC91]*gpASC91	+_b[ASC92]*gpASC92	+_b[ASC93]*gpASC93	+_b[ASC94]*gpASC94	+_b[ASC95]*gpASC95	+_b[ASC96]*gpASC96	+_b[ASC97]*gpASC97	+_b[ASC98]*gpASC98	+_b[ASC99]*gpASC99	+_b[ASC100]*gpASC100	+_b[ASC101]*gpASC101	+_b[ASC102]*gpASC102	+_b[ASC103]*gpASC103	+_b[ASC104]*gpASC104	+_b[ASC105]*gpASC105	+_b[ASC106]*gpASC106	+_b[ASC107]*gpASC107	+_b[ASC108]*gpASC108	+_b[ASC109]*gpASC109	+_b[ASC110]*gpASC110	+_b[ASC111]*gpASC111	+_b[ASC112]*gpASC112	+_b[ASC113]*gpASC113	+_b[ASC114]*gpASC114	+_b[ASC115]*gpASC115	+_b[ASC116]*gpASC116	+_b[ASC117]*gpASC117	+_b[ASC118]*gpASC118	+_b[ASC119]*gpASC119	+_b[ASC120]*gpASC120	+_b[ASC121]*gpASC121	+_b[ASC122]*gpASC122	+_b[ASC123]*gpASC123	+_b[ASC124]*gpASC124	+_b[ASC125]*gpASC125	+_b[ASC126]*gpASC126	+_b[ASC127]*gpASC127)
drop gpASC1-gpASC127	


local i=1																																																																																																																															
while `i' <= 127 {																																																																																																																															
       gen acASC`i'= ASC`i'
       replace acASC`i' = 0 if ASC`i'==1 & (ar==1 | ca==1)
       local i=`i'+1																																																																																																																															
       }																																																																																																																															
gen	Avac=	exp(	_b[ncost3]*ncost3	+	_b[ncflextime3]*ncflextime3+_b[ncrenter3]*ncrenter3+_b[ncinc3]*ncinc3+_b[ASC1]*acASC1+_b[ASC2]*acASC2+_b[ASC3]*acASC3	+_b[ASC4]*acASC4	+_b[ASC5]*acASC5	+_b[ASC6]*acASC6	+_b[ASC7]*acASC7	+_b[ASC8]*acASC8	+_b[ASC9]*acASC9	+_b[ASC10]*acASC10	+_b[ASC11]*acASC11	+_b[ASC12]*acASC12	+_b[ASC13]*acASC13	+_b[ASC14]*acASC14	+_b[ASC15]*acASC15	+_b[ASC16]*acASC16	+_b[ASC17]*acASC17	+_b[ASC18]*acASC18	+_b[ASC19]*acASC19	+_b[ASC20]*acASC20	+_b[ASC21]*acASC21	+_b[ASC22]*acASC22	+_b[ASC23]*acASC23	+_b[ASC24]*acASC24	+_b[ASC25]*acASC25	+_b[ASC26]*acASC26	+_b[ASC27]*acASC27	+_b[ASC28]*acASC28	+_b[ASC29]*acASC29	+_b[ASC30]*acASC30	+_b[ASC31]*acASC31	+_b[ASC32]*acASC32	+_b[ASC33]*acASC33	+_b[ASC34]*acASC34+_b[ASC35]*	acASC35	+_b[ASC36]*acASC36	+_b[ASC37]*acASC37	+_b[ASC38]*acASC38	+_b[ASC39]*acASC39	+_b[ASC40]*acASC40	+_b[ASC41]*acASC41	+_b[ASC42]*acASC42	+_b[ASC43]*acASC43	+_b[ASC44]*acASC44	+_b[ASC45]*acASC45	+_b[ASC46]*acASC46	+_b[ASC47]*acASC47	+_b[ASC48]*acASC48	+_b[ASC49]*acASC49	+_b[ASC50]*acASC50	+_b[ASC51]*acASC51	+_b[ASC52]*acASC52	+_b[ASC53]*acASC53	+_b[ASC54]*acASC54	+_b[ASC55]*acASC55	+_b[ASC56]*acASC56	+_b[ASC57]*acASC57 +_b[ASC58]*acASC58	+_b[ASC59]*acASC59	+_b[ASC60]*acASC60	+_b[ASC61]*acASC61	+_b[ASC62]*acASC62	+_b[ASC63]*acASC63	+_b[ASC64]*acASC64	+_b[ASC65]*acASC65	+_b[ASC66]*acASC66	+_b[ASC67]*acASC67	+_b[ASC68]*acASC68	+_b[ASC69]*acASC69	+_b[ASC70]*acASC70	+_b[ASC71]*acASC71	+_b[ASC72]*acASC72	+_b[ASC73]*acASC73	+_b[ASC74]*acASC74	+_b[ASC75]*acASC75	+_b[ASC76]*acASC76	+_b[ASC77]*acASC77	+_b[ASC78]*acASC78	+_b[ASC79]*acASC79	+_b[ASC80]*acASC80	+_b[ASC81]*acASC81	+_b[ASC82]*acASC82	+_b[ASC83]*acASC83	+_b[ASC84]*acASC84	+_b[ASC85]*acASC85	+_b[ASC86]*acASC86	+_b[ASC87]*acASC87	+_b[ASC88]*acASC88	+_b[ASC89]*acASC89	+_b[ASC90]*acASC90	+_b[ASC91]*acASC91	+_b[ASC92]*acASC92	+_b[ASC93]*acASC93	+_b[ASC94]*acASC94	+_b[ASC95]*acASC95	+_b[ASC96]*acASC96	+_b[ASC97]*acASC97	+_b[ASC98]*acASC98	+_b[ASC99]*acASC99	+_b[ASC100]*acASC100	+_b[ASC101]*acASC101	+_b[ASC102]*acASC102	+_b[ASC103]*acASC103	+_b[ASC104]*acASC104	+_b[ASC105]*acASC105	+_b[ASC106]*acASC106	+_b[ASC107]*acASC107	+_b[ASC108]*acASC108	+_b[ASC109]*acASC109	+_b[ASC110]*acASC110	+_b[ASC111]*acASC111	+_b[ASC112]*acASC112	+_b[ASC113]*acASC113	+_b[ASC114]*acASC114	+_b[ASC115]*acASC115	+_b[ASC116]*acASC116	+_b[ASC117]*acASC117	+_b[ASC118]*acASC118	+_b[ASC119]*acASC119	+_b[ASC120]*acASC120	+_b[ASC121]*acASC121	+_b[ASC122]*acASC122	+_b[ASC123]*acASC123	+_b[ASC124]*acASC124	+_b[ASC125]*acASC125	+_b[ASC126]*acASC126	+_b[ASC127]*acASC127)
drop acASC1-acASC127	

drop ASC1-ASC127


save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\VEH_ASCforSAS15.dta",replace

/***********************************************************************************************************************************************/
// Add vehpers for welfare calculation of per-adt and per-per value//

rename v1 nid
rename v2 vehadts
rename v3 vehkids
rename v4 vehpers

clear all
use "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\vehpers.dta" 
merge m:m nid using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\SLforSAS15.dta"
save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\VEH_SLforSAS15.dta"

clear all
use "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\vehpers.dta" 
merge m:m nid using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\ASCforSAS15.dta"
save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\VEH_ASCLforSAS15.dta"

clear all
use "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\vehpers.dta" 
merge m:m nid using "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\STATA data and code\MLforSAS15.dta"
save "C:\Users\Student\Desktop\ZCHEN\Dissertation - National Park\National Park Final codes and files\Step4\VEH_MLforSAS15.dta"




